AmendHub

Download:

jcs

/

detritus

/

amendments

/

63

html_tree: If styling is off, ignore text in <style> tags


jcs made amendment 63 about 1 year ago
--- html.h Fri Dec 20 20:27:28 2024 +++ html.h Fri Dec 20 23:47:01 2024 @@ -560,6 +560,7 @@ struct html_page { bool ignore_script_data; bool ignore_comment_data; bool scripting; + bool styling; /* if the next character token should be skipped if it's \n */ bool skip_newline_char_token; --- html_tree.c Wed Dec 18 15:55:00 2024 +++ html_tree.c Sat Dec 21 10:07:45 2024 @@ -1852,6 +1852,10 @@ html_process_token_text(struct html_page *html, html_t */ if (token->type == HTML_TOKEN_CHARACTER) { + if (html->current_node && + html->current_node->type == HTML_TAG_STYLE && !html->styling) + return HTML_TOKEN_PROCESSED; + html_insert_character(html, token->ch.c); return HTML_TOKEN_PROCESSED; }