]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix edge case with superscripts and punctuation
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 10 Jan 2018 16:38:30 +0000 (11:38 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 10 Jan 2018 16:38:30 +0000 (11:38 -0500)
Sources/libMultiMarkdown/mmd.c
tests/MMD6Tests/Superscript.fodt
tests/MMD6Tests/Superscript.html
tests/MMD6Tests/Superscript.htmlc
tests/MMD6Tests/Superscript.tex
tests/MMD6Tests/Superscript.text

index f811a602b3ed77b95bc7041f8215d29ee6c08b6f..ece12f137900ebb7e6a1cc7fd1d321825ab1bd55 100644 (file)
@@ -1576,7 +1576,7 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size
 
                                offset = t->start + t->len;
 
-                               if (char_is_whitespace_or_line_ending_or_punctuation(str[offset])) {
+                               if (char_is_whitespace_or_line_ending(str[offset])) {
                                        t->can_open = 0;
                                }
 
index c14c35462c9e0ddde7b9f3d01814307c6873cdc7..bee2b7506d7fe1c25be2f669e1ccbb39370b70e5 100644 (file)
@@ -335,6 +335,16 @@ office:mimetype="application/vnd.oasis.opendocument.text">
 <text:p text:style-name="Standard"><text:span text:style-name="MMD-Subscript">t</text:span>p<text:span text:style-name="MMD-Subscript">x</text:span></text:p>
 
 <text:p text:style-name="Standard"><text:span text:style-name="MMD-Superscript">23</text:span>Na<text:span text:style-name="MMD-Superscript">1+</text:span></text:p>
+
+<text:p text:style-name="Standard">25</text:p>
+
+<text:p text:style-name="Standard">Na<text:span text:style-name="MMD-Superscript">1</text:span>+</text:p>
+
+<text:p text:style-name="Standard">Na<text:span text:style-name="MMD-Superscript">1+</text:span></text:p>
+
+<text:p text:style-name="Standard">Na^+</text:p>
+
+<text:p text:style-name="Standard">Na<text:span text:style-name="MMD-Superscript">+</text:span></text:p>
 </office:text>
 </office:body>
 </office:document>
index 9bd378ef4e79a72b3400e27f4a0779a4c7af5b62..2302bd42776c29e98354cbbc2904ab34e7abec7a 100644 (file)
 
 <p><sup>23</sup>Na<sup>1+</sup></p>
 
+<p>25</p>
+
+<p>Na<sup>1</sup>+</p>
+
+<p>Na<sup>1+</sup></p>
+
+<p>Na^+</p>
+
+<p>Na<sup>+</sup></p>
+
 </body>
 </html>
 
index 638639b5141f58767cded155c41d4334b6af2483..64eebf01f392d63178774e607f4052ddeb8cb20a 100644 (file)
@@ -58,3 +58,13 @@ latex config:        article</p>
 <p>~t~p~x~</p>
 
 <p>^23^Na^1+^</p>
+
+<p>25</p>
+
+<p>Na^1+</p>
+
+<p>Na^1+^</p>
+
+<p>Na^+</p>
+
+<p>Na^+^</p>
index ba419700ad241efa1a5a4ed48fd41f319864ac30..f8c0606d13ebca434f77c072de1a8a2521350de6 100644 (file)
@@ -60,5 +60,15 @@ Ca\textsuperscript{2+}
 
 \textsuperscript{23}Na\textsuperscript{1+}
 
+25
+
+Na\textsuperscript{1}+
+
+Na\textsuperscript{1+}
+
+Na\^{}+
+
+Na\textsuperscript{+}
+
 \input{mmd6-article-footer}
 \end{document}
index fc6d77e0a5f1f35c2eddcb2cf00dfc6fb7a80c09..7282b91212e3c6d1f641cf889497e158e4d2b994 100644 (file)
@@ -58,3 +58,13 @@ CH~3~CH~2~CH~2~CH~3
  ~t~p~x~
 
  ^23^Na^1+^
+
+25
+
+Na^1+
+
+Na^1+^
+
+Na^+
+
+Na^+^