From 374c89be0194109edc5a081f5651d15d34838621 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Tue, 19 Feb 2013 00:43:16 +0100 Subject: [PATCH] Added newline on . The tag
(in contrast to the tag ) is normally used to denote content placed on a line by its own. So it makes sense to trigger a newline when
is processed. --- apps/webbrowser/html-strings | 1 + apps/webbrowser/html-strings.c | 3 ++ apps/webbrowser/html-strings.h | 1 + apps/webbrowser/htmlparser.c | 51 ++++++++++++++++++---------------- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/apps/webbrowser/html-strings b/apps/webbrowser/html-strings index e3c43c93b..5e10d41d4 100644 --- a/apps/webbrowser/html-strings +++ b/apps/webbrowser/html-strings @@ -1,5 +1,6 @@ html_slasha "/a\0" html_slashcenter "/center\0" +html_slashdiv "/div\0" html_slashform "/form\0" html_slashh "/h\0" html_slashscript "/script\0" diff --git a/apps/webbrowser/html-strings.c b/apps/webbrowser/html-strings.c index 6292280e6..cb4b05629 100644 --- a/apps/webbrowser/html-strings.c +++ b/apps/webbrowser/html-strings.c @@ -4,6 +4,9 @@ const char html_slasha[4] = const char html_slashcenter[9] = /* "/center\0" */ {0x2f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 00, }; +const char html_slashdiv[6] = +/* "/div\0" */ +{0x2f, 0x64, 0x69, 0x76, 00, }; const char html_slashform[7] = /* "/form\0" */ {0x2f, 0x66, 0x6f, 0x72, 0x6d, 00, }; diff --git a/apps/webbrowser/html-strings.h b/apps/webbrowser/html-strings.h index 21c6c129d..b10a78c59 100644 --- a/apps/webbrowser/html-strings.h +++ b/apps/webbrowser/html-strings.h @@ -1,5 +1,6 @@ extern const char html_slasha[4]; extern const char html_slashcenter[9]; +extern const char html_slashdiv[6]; extern const char html_slashform[7]; extern const char html_slashh[4]; extern const char html_slashscript[9]; diff --git a/apps/webbrowser/htmlparser.c b/apps/webbrowser/htmlparser.c index c33640191..20d74deeb 100644 --- a/apps/webbrowser/htmlparser.c +++ b/apps/webbrowser/htmlparser.c @@ -179,53 +179,55 @@ static const char *tags[] = { html_slasha, #define TAG_SLASHCENTER 1 html_slashcenter, -#define TAG_SLASHFORM 2 +#define TAG_SLASHDIV 2 + html_slashdiv, +#define TAG_SLASHFORM 3 html_slashform, -#define TAG_SLASHH 3 +#define TAG_SLASHH 4 html_slashh, -#define TAG_SLASHSCRIPT 4 +#define TAG_SLASHSCRIPT 5 html_slashscript, -#define TAG_SLASHSELECT 5 +#define TAG_SLASHSELECT 6 html_slashselect, -#define TAG_SLASHSTYLE 6 +#define TAG_SLASHSTYLE 7 html_slashstyle, -#define TAG_A 7 +#define TAG_A 8 html_a, -#define TAG_BODY 8 +#define TAG_BODY 9 html_body, -#define TAG_BR 9 +#define TAG_BR 10 html_br, -#define TAG_CENTER 10 +#define TAG_CENTER 11 html_center, -#define TAG_FORM 11 +#define TAG_FORM 12 html_form, -#define TAG_FRAME 12 +#define TAG_FRAME 13 html_frame, -#define TAG_H1 13 +#define TAG_H1 14 html_h1, -#define TAG_H2 14 +#define TAG_H2 15 html_h2, -#define TAG_H3 15 +#define TAG_H3 16 html_h3, -#define TAG_H4 16 +#define TAG_H4 17 html_h4, -#define TAG_IMG 17 +#define TAG_IMG 18 html_img, -#define TAG_INPUT 18 +#define TAG_INPUT 19 html_input, -#define TAG_LI 19 +#define TAG_LI 20 html_li, -#define TAG_P 20 +#define TAG_P 21 html_p, -#define TAG_SCRIPT 21 +#define TAG_SCRIPT 22 html_script, -#define TAG_SELECT 22 +#define TAG_SELECT 23 html_select, -#define TAG_STYLE 23 +#define TAG_STYLE 24 html_style, -#define TAG_TR 24 +#define TAG_TR 25 html_tr, -#define TAG_LAST 25 +#define TAG_LAST 26 last, }; @@ -376,6 +378,7 @@ parse_tag(void) /* FALLTHROUGH */ case TAG_BR: case TAG_TR: + case TAG_SLASHDIV: case TAG_SLASHH: /* parse_char(ISO_nl);*/ dummy = 0;