aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2012-12-15 05:21:50 +0000
committercorvid <corvid@lavabit.com>2012-12-15 05:21:50 +0000
commit4071f894114fab5b4087de3ddfaa32fef441f9cf (patch)
tree93115eda06b9f2167284786cd069e8ab9f979f9b
parent565f21fba29f87c843c0e3d06b22879755de8bf9 (diff)
finish option as soon as we see the close tag
I was just looking at distrowatch, and noticed that a menu looked odd. It turns out that their code goes like Amarok Live<option value="amaroklive">Amarok Live</option> Amber<option value="amber">Amber</option> Ankur Bangla<option value="ankur">Ankur Bangla</option> Annvix<option value="annvix">Annvix</option> AnNyung<option value="annyung">AnNyung</option> Anonym.OS<option value="anonymos">Anonym.OS</option> for some crazy reason. This led to dillo showing labels like "AnNyung Anonym.OS".
-rw-r--r--src/form.cc8
-rw-r--r--src/form.hh1
-rw-r--r--src/html.cc2
3 files changed, 10 insertions, 1 deletions
diff --git a/src/form.cc b/src/form.cc
index 6f272b8f..8ec340bb 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -823,6 +823,14 @@ void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize)
a_Html_stash_init(html);
}
+void Html_tag_close_option(DilloHtml *html)
+{
+ if (html->InFlags & IN_OPTION) {
+ Html_option_finish(html);
+ html->InFlags &= ~IN_OPTION;
+ }
+}
+
/*
* <BUTTON>
*/
diff --git a/src/form.hh b/src/form.hh
index 297442e0..640e7e69 100644
--- a/src/form.hh
+++ b/src/form.hh
@@ -57,6 +57,7 @@ void Html_tag_close_textarea(DilloHtml *html);
void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize);
void Html_tag_close_select(DilloHtml *html);
void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize);
+void Html_tag_close_option(DilloHtml *html);
void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize);
void Html_tag_close_button(DilloHtml *html);
diff --git a/src/html.cc b/src/html.cc
index 8e0af8a9..20a7f7d5 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -3195,7 +3195,7 @@ const TagInfo Tags[] = {
{"object", B8(111101),'R',2, Html_tag_open_object, NULL, NULL},
{"ol", B8(011010),'R',2, Html_tag_open_ol, NULL, NULL},
/* optgroup */
- {"option", B8(010001),'O',1, Html_tag_open_option, NULL, NULL},
+ {"option", B8(010001),'O',1, Html_tag_open_option,NULL,Html_tag_close_option},
{"p", B8(010110),'O',1, Html_tag_open_p, NULL, NULL},
/* param 010001 'F' */
{"pre", B8(010110),'R',2, Html_tag_open_pre, NULL, Html_tag_close_pre},