]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Allow caption without trailing newline at end of document
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 30 Apr 2018 17:07:50 +0000 (13:07 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 30 Apr 2018 17:07:50 +0000 (13:07 -0400)
Sources/libMultiMarkdown/writer.c
tests/MMD6Tests/Tables.fodt
tests/MMD6Tests/Tables.html
tests/MMD6Tests/Tables.htmlc
tests/MMD6Tests/Tables.tex
tests/MMD6Tests/Tables.text

index 7deec97c0da4a226cd2ab17d8a3fdde1c7893487..e912c3e79cf18bebd381c4399db218a35ebb22af 100644 (file)
@@ -2479,6 +2479,11 @@ bool table_has_caption(token * t) {
                                t = t->next;
                        }
 
+                       if (t == NULL) {
+                               // End of file
+                               return true;
+                       }
+
                        if (t && t->next &&
                                        ((t->next->type == TEXT_NL) ||
                                         (t->next->type == TEXT_LINEBREAK))) {
index e3fb9d0ad428bee8f3a8dcfd164d87939a0efd4f..11b55a00be3281b6a28444c6d28fd0271db5c286 100644 (file)
@@ -563,6 +563,7 @@ office:mimetype="application/vnd.oasis.opendocument.text">
 </table:table-row>
 
 </table:table>
+<text:p><text:bookmark text:name="notrailingnewline"/>Table <text:sequence text:name="Table" text:formula="ooow:Table+1" style:num-format="1"> Update Fields to calculate numbers</text:sequence>:<text:span text:style-name="MMD-Bold">no trailing newline</text:span><text:bookmark-end text:name="notrailingnewline"/></text:p>
 
 </office:text>
 </office:body>
index 13dde9db8936e2ea411a88810db91af46bac6fbc..db909d1ae14a44f6f46e8069cca992c9f970f972 100644 (file)
 </table>
 
 <table>
+<caption style="caption-side: bottom;" id="notrailingnewline"><strong>no trailing newline</strong></caption>
 <colgroup>
 <col />
 <col />
index bc6f092cdee5d6894025db76543e5b9af6f959fd..63b29ebdf48aaac45d5be98e8b86b84bd27e45e6 100644 (file)
@@ -60,4 +60,5 @@ latex config: article</p>
 <p>| bat ||
 | foo | bar |
 | --- | --- |
-| foo | bar |</p>
+| foo | bar |
+[<strong>no trailing newline</strong>]</p>
index 851eb2674e6ea82983ada935c3a73f7932797dfd..e7bf35f1aacaac60d621db638c91dbb18cb17a03 100644 (file)
 \setlength{\tymax}{0.5\linewidth}
 \centering
 \small
+\caption{\textbf{no trailing newline}}
+\label{notrailingnewline}
 \begin{tabulary}{\textwidth}{@{}ll@{}} \toprule
 \multicolumn{2}{c}{ bat }\\
  foo & bar \\
index 40a2bcc81f955b616afd2753fdacd3920cde72ae..9c4e5dba437edb3db2d4242b0a67f939dc34b3c6 100644 (file)
@@ -67,3 +67,4 @@ latex config: article
 | foo | bar |
 | --- | --- |
 | foo | bar |
+[**no trailing newline**]
\ No newline at end of file