]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix error in CriticMarkup highlights when accepting/rejecting (Thanks, Shahaf!)
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Thu, 17 Aug 2017 18:38:06 +0000 (14:38 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Thu, 17 Aug 2017 18:38:06 +0000 (14:38 -0400)
Sources/libMultiMarkdown/critic_markup.c
Sources/libMultiMarkdown/fodt.c
Sources/libMultiMarkdown/html.c
Sources/libMultiMarkdown/latex.c
Sources/libMultiMarkdown/opendocument-content.c
tests/CriticMarkup/CriticMarkup.html
tests/CriticMarkup/CriticMarkup.htmla
tests/CriticMarkup/CriticMarkup.htmlr
tests/CriticMarkup/CriticMarkup.text

index 43d47a43db7de50119df2243a10b7a7a2fb9a34b..0afe3cda419494684bb23be54ae970b32db6461a 100644 (file)
@@ -198,7 +198,6 @@ void accept_token(DString * d, token * t) {
                case CM_SUB_DIV:
                case CM_DEL_PAIR:
                case CM_COM_PAIR:
-               case CM_HI_PAIR:
                        // Erase these
                        d_string_erase(d, t->start, t->len);
                        break;
@@ -213,6 +212,7 @@ void accept_token(DString * d, token * t) {
                        break;
 
                case CM_ADD_PAIR:
+               case CM_HI_PAIR:
 
                        // Check children
                        if (t->child) {
@@ -282,7 +282,6 @@ void reject_token(DString * d, token * t) {
                case CM_SUB_DIV:
                case CM_ADD_PAIR:
                case CM_COM_PAIR:
-               case CM_HI_PAIR:
                        // Erase these
                        d_string_erase(d, t->start, t->len);
                        break;
@@ -297,6 +296,7 @@ void reject_token(DString * d, token * t) {
                        break;
 
                case CM_DEL_PAIR:
+               case CM_HI_PAIR:
 
                        // Check children
                        if (t->child) {
index 54ffd7f4698aa41956bb8770a2455e721e84f6e9..ebfd32fa99bbbdd191279d9cf792333e2849c85e 100644 (file)
@@ -1570,6 +1570,9 @@ parse_citation:
                        // Ignore if we're rejecting or accepting
                        if ((scratch->extensions & EXT_CRITIC_REJECT) ||
                                (scratch->extensions & EXT_CRITIC_ACCEPT)) {
+                               t->child->type = TEXT_EMPTY;
+                               t->child->mate->type = TEXT_EMPTY;
+                               mmd_export_token_tree_odf(out, source, t->child, scratch);
                                break;
                        }
 
index db1e365cc9cbe2bbf234a0b969128a8384cac901..1d0027a71811957210e546254879fc86b33f2785 100644 (file)
@@ -1732,6 +1732,9 @@ parse_citation:
                        // Ignore if we're rejecting or accepting
                        if ((scratch->extensions & EXT_CRITIC_REJECT) ||
                                (scratch->extensions & EXT_CRITIC_ACCEPT)) {
+                               t->child->type = TEXT_EMPTY;
+                               t->child->mate->type = TEXT_EMPTY;
+                               mmd_export_token_tree_html(out, source, t->child, scratch);
                                break;
                        }
 
index efa32f24024702ce26ef135b22e6d997c028c642..3858d645e73ffb305a30027df26eae301eec96d5 100644 (file)
@@ -1651,6 +1651,9 @@ parse_citation:
                        // Ignore if we're rejecting or accepting
                        if ((scratch->extensions & EXT_CRITIC_REJECT) ||
                                (scratch->extensions & EXT_CRITIC_ACCEPT)) {
+                               t->child->type = TEXT_EMPTY;
+                               t->child->mate->type = TEXT_EMPTY;
+                               mmd_export_token_tree_latex(out, source, t->child, scratch);
                                break;
                        }
 
index 18ac45fda66676792c2580dfd4b15d146e2d6472..595fb45b4b03fd29166ef9f4fffb2ddc1804c1ca 100644 (file)
@@ -1703,6 +1703,9 @@ parse_citation:
                        // Ignore if we're rejecting or accepting
                        if ((scratch->extensions & EXT_CRITIC_REJECT) ||
                                (scratch->extensions & EXT_CRITIC_ACCEPT)) {
+                               t->child->type = TEXT_EMPTY;
+                               t->child->mate->type = TEXT_EMPTY;
+                               mmd_export_token_tree_opendocument(out, source, t->child, scratch);
                                break;
                        }
 
index d1799670aaeb1ce4f1e9f78e16030921c488a69b..84da01ec1d3d6a5dd660474257fd2f662c15d6cb 100644 (file)
 
 <p>~~}between them.</p>
 
+<p><ins>foo</ins></p>
+
+<p><del>bar</del></p>
+
+<p><del>foo</del><ins>bar</ins></p>
+
+<p><span class="critic comment">foo</span></p>
+
+<p><mark>bar</mark></p>
+
 </body>
 </html>
 
index d4e30615c0baa48f0827090a815f0bc3a7edd97b..4b673dd228257207cb0bc3eea4372d6048cee80b 100644 (file)
 
 <p>between them.</p>
 
+<p>foo</p>
+
+<p>bar</p>
+
+<p>bar</p>
+
 </body>
 </html>
 
index 773c00c456cd99a65ce60a0fa68a818c92fd904f..029050aa50885937bbe46926e305c52d479de9b4 100644 (file)
 
 <p>with nothing between them.</p>
 
+<p>bar</p>
+
+<p>foo</p>
+
+<p>bar</p>
+
 </body>
 </html>
 
index e63017a7c0328847720a4beb84a2caba7deab951..8f5fd06244f0d5f4bcecd90f616101c8ea948488 100644 (file)
@@ -16,3 +16,13 @@ with nothing ~>
 With a *new* paragraph inserted
 
 ~~}between them.
+
+{++foo++}
+
+{--bar--}
+
+{~~foo~>bar~~}
+
+{>>foo<<}
+
+{==bar==}