]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix underscore strong/emph around punctuation
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 17 Apr 2017 13:50:38 +0000 (09:50 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 17 Apr 2017 13:50:38 +0000 (09:50 -0400)
Sources/libMultiMarkdown/mmd.c
tests/MMD6Tests/Emph and Strong Star.fodt
tests/MMD6Tests/Emph and Strong Star.html
tests/MMD6Tests/Emph and Strong Star.htmlc
tests/MMD6Tests/Emph and Strong Star.tex
tests/MMD6Tests/Emph and Strong Star.text
tests/MMD6Tests/Emph and Strong UL.fodt
tests/MMD6Tests/Emph and Strong UL.html
tests/MMD6Tests/Emph and Strong UL.htmlc
tests/MMD6Tests/Emph and Strong UL.tex
tests/MMD6Tests/Emph and Strong UL.text

index 4e4af0fe0d80025e54a5700d5074ee3301aade07..a3ec204714a3c569b38cd447835e5277814dc115 100644 (file)
@@ -1198,8 +1198,8 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size
                                        offset--;
                                }
                                
-                               if ((offset == 0) || (char_is_whitespace_or_line_ending_or_punctuation(str[offset]))) {
-                                       // Whitespace or punctuation to left, so can't close
+                               if ((offset == 0) || (char_is_whitespace_or_line_ending(str[offset]))) {
+                                       // Whitespace to left, so can't close
                                        t->can_close = 0;
                                }
 
@@ -1215,7 +1215,7 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size
                                while ((str[offset] == '*') || (str[offset] == '_'))
                                        offset++;
                                
-                               if (char_is_whitespace_or_line_ending_or_punctuation(str[offset])) {
+                               if (char_is_whitespace_or_line_ending(str[offset])) {
                                        // Whitespace to right, so can't open
                                        t->can_open = 0;
                                }
index 3017655e4e682da034244f639919200f344c94eb..8b2a9929102155f3e07104ce3cdb7e68ba26596a 100644 (file)
 
 <text:p text:style-name="Standard"><text:span text:style-name="MMD-Bold">foo:</text:span> bar</text:p>
 
+<text:p text:style-name="Standard"><text:span text:style-name="MMD-Italic">foo [bar]</text:span></text:p>
+
+<text:p text:style-name="Standard">50</text:p>
+
 <text:p text:style-name="Standard">*foo
 *foo
 *foo
index 398dd274127259735e27b1108f72eb0ac28f1d1a..55a4c192a794d6a4d5c50fd2c0035f4b71df144f 100644 (file)
 
 <p><strong>foo:</strong> bar</p>
 
+<p><em>foo [bar]</em></p>
+
+<p>50</p>
+
 <p>*foo
 *foo
 *foo
index cad2f55b9eb2c5e0e00bf735e90ce74a8571462a..ed66495f6962c6becffc3aa7ffbfd41ca40b3a5e 100644 (file)
@@ -117,6 +117,10 @@ latex config:      article</p>
 
 <p><strong>foo:</strong> bar</p>
 
+<p><em>foo [bar]</em></p>
+
+<p>50</p>
+
 <p>*foo
 *foo
 *foo
index fd82256fd5e8782f1aafc14568c531af1e12be53..5b1cf15cce6c967fe89d2ccad3c0dd852bd7bd6e 100644 (file)
@@ -118,6 +118,10 @@ foo \textbf{1. bar}
 
 \textbf{foo:} bar
 
+\emph{foo [bar]}
+
+50
+
 *foo
 *foo
 *foo
index 74ffd5951d73ef1b0a928af5877e4ed3dc24b856..105a8c40ed795a123d6240e17886cd10854e55f6 100644 (file)
@@ -117,6 +117,10 @@ foo **1. bar**
 
 **foo:** bar
 
+*foo [bar]*
+
+50
+
 *foo
 *foo
 *foo
index ab30a8abe84ea4f805e77863dc9744dd40fa7cf2..30c33ab6a97fb6f37b2677d66c41c4f355583bbe 100644 (file)
 
 <text:p text:style-name="Standard">foo___bar foo___bar</text:p>
 
-<text:p text:style-name="Standard">foo __- bar__</text:p>
+<text:p text:style-name="Standard">foo <text:span text:style-name="MMD-Bold">- bar</text:span></text:p>
 
 <text:p text:style-name="Standard">foo <text:span text:style-name="MMD-Bold">1. bar</text:span></text:p>
 
+<text:p text:style-name="Standard"><text:span text:style-name="MMD-Bold">foo:</text:span> bar</text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="MMD-Italic">foo [bar]</text:span></text:p>
+
+<text:p text:style-name="Standard">50</text:p>
+
 <text:p text:style-name="Standard">_foo
 _foo
 _foo
index 155d28fa3ae125412d470fdaa8277c4e1ae5acdb..1a1d458848766dae394bc836c588facae5e46736 100644 (file)
 
 <p>foo___bar foo___bar</p>
 
-<p>foo __- bar__</p>
+<p>foo <strong>- bar</strong></p>
 
 <p>foo <strong>1. bar</strong></p>
 
+<p><strong>foo:</strong> bar</p>
+
+<p><em>foo [bar]</em></p>
+
+<p>50</p>
+
 <p>_foo
 _foo
 _foo
index a351fe13db897b4f12534ebb2e12d3c16f9aac1e..ab3f06e9362a371b90665158833fa68270d83dd3 100644 (file)
@@ -111,10 +111,16 @@ latex config:     article</p>
 
 <p>foo___bar foo___bar</p>
 
-<p>foo __- bar__</p>
+<p>foo <strong>- bar</strong></p>
 
 <p>foo <strong>1. bar</strong></p>
 
+<p><strong>foo:</strong> bar</p>
+
+<p><em>foo [bar]</em></p>
+
+<p>50</p>
+
 <p>_foo
 _foo
 _foo
index 09409649973dbca12af6b5a85bf82e1b0f9f6b4d..07a765b92f2cb41fa111056c6e27be025c780f22 100644 (file)
@@ -112,10 +112,16 @@ foo\_\_\_bar
 
 foo\_\_\_bar foo\_\_\_bar
 
-foo \_\_- bar\_\_
+foo \textbf{- bar}
 
 foo \textbf{1. bar}
 
+\textbf{foo:} bar
+
+\emph{foo [bar]}
+
+50
+
 \_foo
 \_foo
 \_foo
index 7f4c95e6c3de7188b7481aff5db74484b00ab0fb..c1018737ca4c9a1137227b2733222d786087bb73 100644 (file)
@@ -115,6 +115,12 @@ foo __- bar__
 
 foo __1. bar__
 
+__foo:__ bar
+
+_foo [bar]_
+
+50
+
 _foo
 _foo
 _foo