diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-06-22 20:51:40 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-10-01 20:58:38 +0200 |
commit | e7fee996f1b634aa5ef0a0a20f0be239c83602b8 (patch) | |
tree | 74e61072a53b886d642ae244911493989b3f8820 /src | |
parent | 3eb7b5544452ab001f3c570ddd5760bcc61f413c (diff) |
Trigger a close of td, th and tr tags on tbody
When previous TD, TH or TR tags were left open, close them when a TBODY
tag is found.
Diffstat (limited to 'src')
-rw-r--r-- | src/html.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/html.cc b/src/html.cc index 3297796a..ac5dd1ab 100644 --- a/src/html.cc +++ b/src/html.cc @@ -137,6 +137,7 @@ static int i_TEXTAREA = a_Html_tag_index("textarea"), i_TD = a_Html_tag_index("td"), i_TR = a_Html_tag_index("tr"), + i_TBODY = a_Html_tag_index("tbody"), i_TH = a_Html_tag_index("th"); @@ -3646,10 +3647,10 @@ static int Html_triggers_optional_close(int old_idx, int cur_idx) } else if (old_idx == i_TD || old_idx == i_TH) { /* TD and TH are closed by: TD, TH and TR. * Note: non-flow should also close it, but FF does not. */ - return (cur_idx == i_TD || cur_idx == i_TH || cur_idx == i_TR); + return (cur_idx == i_TD || cur_idx == i_TH || cur_idx == i_TR || cur_idx == i_TBODY); } else if (old_idx == i_TR) { /* TR closes TR */ - return (cur_idx == i_TR); + return (cur_idx == i_TR || cur_idx == i_TBODY); } else if (old_idx == i_DD) { /* DD is closed by DD and DT */ return (cur_idx == i_DD || cur_idx == i_DT); |