mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-01 03:36:26 -04:00
Initialize the renderer before initializing the parser
... so it is ready when/if the parser will push any initial states.
This commit is contained in:
parent
65b504f093
commit
2dddf86acc
@ -700,13 +700,6 @@ render_dom_document(struct cache_entry *cached, struct document *document,
|
||||
|
||||
assert(document->options.plain);
|
||||
|
||||
parser = init_sgml_parser(SGML_PARSER_STREAM, cached, document);
|
||||
if (!parser) return;
|
||||
|
||||
root = parse_sgml(parser, buffer);
|
||||
done_sgml_parser(parser);
|
||||
if (!root) return;
|
||||
|
||||
convert_table = get_convert_table(head, document->options.cp,
|
||||
document->options.assume_cp,
|
||||
&document->cp,
|
||||
@ -718,6 +711,19 @@ render_dom_document(struct cache_entry *cached, struct document *document,
|
||||
|
||||
document->bgcolor = document->options.default_bg;
|
||||
|
||||
parser = init_sgml_parser(SGML_PARSER_STREAM, cached, document);
|
||||
if (!parser) {
|
||||
done_dom_stack(&stack);
|
||||
return;
|
||||
}
|
||||
|
||||
root = parse_sgml(parser, buffer);
|
||||
done_sgml_parser(parser);
|
||||
if (!root) {
|
||||
done_dom_stack(&stack);
|
||||
return;
|
||||
}
|
||||
|
||||
walk_dom_nodes(&stack, root);
|
||||
/* If there are no non-element nodes after the last element node make
|
||||
* sure that we flush to the end of the cache entry source including
|
||||
|
Loading…
Reference in New Issue
Block a user