1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

Save the end tag token in the SGML parser state

... so that the renderer eventually can pick it up and highlight it.
This commit is contained in:
Jonas Fonseca 2005-12-05 19:28:23 +01:00 committed by Jonas Fonseca
parent 7a912795e1
commit d7d5fcab4d
2 changed files with 15 additions and 0 deletions

View File

@ -247,6 +247,18 @@ parse_sgml_document(struct dom_stack *stack, struct scanner *scanner)
if (!token->length) {
pop_dom_node(stack);
} else {
struct dom_stack_state *state;
state = search_dom_stack(stack, DOM_NODE_ELEMENT,
token->string, token->length);
if (state) {
struct sgml_parser_state *pstate;
pstate = get_dom_stack_state_data(stack, state);
copy_struct(&pstate->end_token, token);
}
pop_dom_nodes(stack, DOM_NODE_ELEMENT,
token->string, token->length);
}

View File

@ -38,6 +38,9 @@ struct sgml_parser {
struct sgml_parser_state {
struct sgml_node_info *info;
/* This is used by the DOM source renderer for highlighting the
* end-tag of an element. */
struct scanner_token end_token;
};
struct sgml_parser *