]> granicus.if.org Git - multimarkdown/commitdiff
UPDATED: table id attribute should be on table not caption
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 8 Oct 2018 19:09:01 +0000 (15:09 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 8 Oct 2018 19:09:01 +0000 (15:09 -0400)
Sources/libMultiMarkdown/html.c
tests/MMD6Tests/Abbreviations.html
tests/MMD6Tests/Tables.html

index 818aec5f6d39f0549ebe5ddffb443f7ef2339217..877cd4ad0ce56c79f8b25b070811a9b9e4f30aae 100644 (file)
@@ -892,7 +892,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
 
                case BLOCK_TABLE:
                        pad(out, 2, scratch);
-                       print_const("<table>\n");
+                       print_const("<table");
 
                        // Are we followed by a caption?
                        if (table_has_caption(t)) {
@@ -904,7 +904,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
                                }
 
                                temp_char = label_from_token(source, temp_token);
-                               printf("<caption style=\"caption-side: bottom;\" id=\"%s\">", temp_char);
+                               printf(" id=\"%s\">\n<caption style=\"caption-side: bottom;\">", temp_char);
                                free(temp_char);
 
                                t->next->child->child->type = TEXT_EMPTY;
@@ -913,6 +913,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
                                print_const("</caption>\n");
                                temp_short = 1;
                        } else {
+                               print_const(">\n");
                                temp_short = 0;
                        }
 
index e2431d291776256d048507553dbf32beb44ce059..a93022594b7130566adf5c4aa662e40a6cd878c2 100644 (file)
@@ -45,8 +45,8 @@
 
 <p>15</p>
 
-<table>
-<caption style="caption-side: bottom;" id="foobar"><abbr title="FOO BAR">foo bar</abbr></caption>
+<table id="foobar">
+<caption style="caption-side: bottom;"><abbr title="FOO BAR">foo bar</abbr></caption>
 <colgroup>
 <col />
 <col />
index db909d1ae14a44f6f46e8069cca992c9f970f972..825ccb1ee7859f8c3e1a683e214f3c82cc3f1592 100644 (file)
 </tbody>
 </table>
 
-<table>
-<caption style="caption-side: bottom;" id="bar"><em>caption</em></caption>
+<table id="bar">
+<caption style="caption-side: bottom;"><em>caption</em></caption>
 <colgroup>
 <col />
 <col />
 </tbody>
 </table>
 
-<table>
-<caption style="caption-side: bottom;" id="caption"><em>caption</em></caption>
+<table id="caption">
+<caption style="caption-side: bottom;"><em>caption</em></caption>
 <colgroup>
 <col />
 <col />
 
 <p>6</p>
 
-<table>
-<caption style="caption-side: bottom;" id="bar"><em>caption</em></caption>
+<table id="bar">
+<caption style="caption-side: bottom;"><em>caption</em></caption>
 <colgroup>
 <col />
 <col />
 </tbody>
 </table>
 
-<table>
-<caption style="caption-side: bottom;" id="notrailingnewline"><strong>no trailing newline</strong></caption>
+<table id="notrailingnewline">
+<caption style="caption-side: bottom;"><strong>no trailing newline</strong></caption>
 <colgroup>
 <col />
 <col />