Skip to content

Commit

Permalink
Improved dicarding of text in the HTML header.
Browse files Browse the repository at this point in the history
Plain text in the HTML header (think of <title>text</title>) is collected as usual. The decision to discard it is triggered by the first withspace following. In the usual case of the <body> no preceeded by any whitespace this means that by the point the first whitespace is encountered we're not in "discard mode" anymore and therefore incorrectly render the text.

Explicitly calling do_word() just before leaving "discard mode" discards all text collected so far.
  • Loading branch information
oliverschmidt committed Oct 11, 2016
1 parent 72cc19c commit 957ac63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions apps/webbrowser/htmlparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ parse_tag(void)
switch_majorstate(s.lastmajorstate);
break;
case TAG_BODY:
do_word();
s.majorstate = s.lastmajorstate = MAJORSTATE_BODY;
break;
case TAG_IMG:
Expand Down

0 comments on commit 957ac63

Please sign in to comment.