mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Introduce pop_html_element(); wraps kill_html_stack_item(..., html_top)
This commit is contained in:
parent
94fd9303f3
commit
fe10af364d
@ -254,7 +254,7 @@ html_input_format(struct html_context *html_context, unsigned char *a,
|
||||
case FC_HIDDEN:
|
||||
INTERNAL("bad control type");
|
||||
}
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
put_chrs(html_context, " ", 1);
|
||||
}
|
||||
|
||||
@ -498,7 +498,7 @@ end_parse:
|
||||
for (i = 0; i < max_width; i++)
|
||||
put_chrs(html_context, "_", 1);
|
||||
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
put_chrs(html_context, "]", 1);
|
||||
html_context->special_f(html_context, SP_CONTROL, fc);
|
||||
}
|
||||
@ -603,7 +603,7 @@ end_parse:
|
||||
format.form = fc;
|
||||
format.style.attr |= AT_BOLD;
|
||||
put_chrs(html_context, "[ ]", 3);
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
put_chrs(html_context, " ", 1);
|
||||
html_context->special_f(html_context, SP_CONTROL, fc);
|
||||
}
|
||||
@ -709,7 +709,7 @@ pp:
|
||||
ln_break(html_context, 1);
|
||||
}
|
||||
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
if (rows > 1)
|
||||
ln_break(html_context, 1);
|
||||
else
|
||||
|
@ -586,7 +586,7 @@ html_hr(struct html_context *html_context, unsigned char *a,
|
||||
}
|
||||
html_context->special_f(html_context, SP_NOWRAP, 0);
|
||||
ln_break(html_context, 2);
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -89,7 +89,7 @@ html_a(struct html_context *html_context, unsigned char *a,
|
||||
html_focusable(html_context, a);
|
||||
|
||||
} else {
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
}
|
||||
|
||||
set_fragment_identifier(html_context, a, "name");
|
||||
@ -269,7 +269,7 @@ html_img_do(unsigned char *a, unsigned char *object_src,
|
||||
* If not, just exit now. */
|
||||
if (!options->images && !format.link) {
|
||||
mem_free_if(src);
|
||||
if (usemap) kill_html_stack_item(html_context, html_top);
|
||||
if (usemap) kill_html_stack_top(html_context);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ html_img_do(unsigned char *a, unsigned char *object_src,
|
||||
|
||||
put_image_label(a, label, html_context);
|
||||
|
||||
if (ismap) kill_html_stack_item(html_context, html_top);
|
||||
if (ismap) kill_html_stack_top(html_context);
|
||||
mem_free_set(&format.image, NULL);
|
||||
mem_free_set(&format.title, NULL);
|
||||
}
|
||||
@ -341,7 +341,7 @@ html_img_do(unsigned char *a, unsigned char *object_src,
|
||||
}
|
||||
|
||||
mem_free_if(src);
|
||||
if (usemap) kill_html_stack_item(html_context, html_top);
|
||||
if (usemap) kill_html_stack_top(html_context);
|
||||
}
|
||||
|
||||
void
|
||||
@ -369,7 +369,7 @@ put_link_line(unsigned char *prefix, unsigned char *linkname,
|
||||
format.style.fg = format.clink;
|
||||
put_chrs(html_context, linkname, strlen(linkname));
|
||||
ln_break(html_context, 1);
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
}
|
||||
|
||||
|
||||
|
@ -767,7 +767,7 @@ start_element(struct element_info *ei,
|
||||
#endif
|
||||
|
||||
if (html_top->type == ELEMENT_WEAK) {
|
||||
kill_html_stack_item(html_context, html_top);
|
||||
kill_html_stack_top(html_context);
|
||||
}
|
||||
|
||||
/* We try to process nested <script> if we didn't process the parent
|
||||
|
@ -14,6 +14,8 @@ void html_stack_dup(struct html_context *html_context,
|
||||
|
||||
void kill_html_stack_item(struct html_context *html_context,
|
||||
struct html_element *e);
|
||||
#define kill_html_stack_top(html_context) \
|
||||
kill_html_stack_item(html_context, html_top)
|
||||
void kill_html_stack_until(struct html_context *html_context, int ls, ...);
|
||||
|
||||
/* void dump_html_stack(struct html_context *html_context); */
|
||||
|
Loading…
Reference in New Issue
Block a user