]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Properly assign ambidextrous tokens in tables
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 10 Jan 2018 16:30:42 +0000 (11:30 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 10 Jan 2018 16:30:42 +0000 (11:30 -0500)
Sources/libMultiMarkdown/html.c
Sources/libMultiMarkdown/mmd.c
tests/MMD6Tests/Tables.fodt
tests/MMD6Tests/Tables.html
tests/MMD6Tests/Tables.tex

index 0fa1f28e3e9f493beb276f01517aa0d41858e174..fa782f867ab2d7678ddddd9682ae883c845d731c 100644 (file)
@@ -368,12 +368,12 @@ void mmd_export_image_html(DString * out, const char * source, token * text, lin
                if (strcmp(a->key, "width") == 0) {
                        width = strip_dimension_units(a->value);
 
-            if (strlen(width) + 2 == strlen(a->value)) {
-                if (strcmp(&(a->value[strlen(width)]), "px") == 0) {
-                    a->value[strlen(width)] = '\0';
-                }
-            }
-            
+                       if (strlen(width) + 2 == strlen(a->value)) {
+                               if (strcmp(&(a->value[strlen(width)]), "px") == 0) {
+                                       a->value[strlen(width)] = '\0';
+                               }
+                       }
+
                        if (strcmp(a->value, width) == 0) {
                                print_const(" ");
                                print(a->key);
@@ -389,12 +389,12 @@ void mmd_export_image_html(DString * out, const char * source, token * text, lin
                } else if (strcmp(a->key, "height") == 0) {
                        height = strip_dimension_units(a->value);
 
-            if (strlen(height) + 2 == strlen(a->value)) {
-                if (strcmp(&(a->value[strlen(height)]), "px") == 0) {
-                    a->value[strlen(height)] = '\0';
-                }
-            }
-            
+                       if (strlen(height) + 2 == strlen(a->value)) {
+                               if (strcmp(&(a->value[strlen(height)]), "px") == 0) {
+                                       a->value[strlen(height)] = '\0';
+                               }
+                       }
+
                        if (strcmp(a->value, height) == 0) {
                                print_const(" ");
                                print(a->key);
@@ -2074,27 +2074,27 @@ void mmd_export_token_html_raw(DString * out, const char * source, token * t, sc
                        print_const("&lt;");
                        break;
 
-        case CRITIC_COM_OPEN:
-            print_const("{&gt;&gt;");
-            break;
-            
-        case CRITIC_COM_CLOSE:
-            print_const("&lt;&lt;}");
-            break;
-
-        case CRITIC_SUB_DIV:
-            print_const("~&gt;");
-            break;
-            
-        case CRITIC_SUB_DIV_A:
-            print_const("~");
-            break;
-            
-        case CRITIC_SUB_DIV_B:
-            print_const("&gt;");
-            break;
-            
-        case ESCAPED_CHARACTER:
+               case CRITIC_COM_OPEN:
+                       print_const("{&gt;&gt;");
+                       break;
+
+               case CRITIC_COM_CLOSE:
+                       print_const("&lt;&lt;}");
+                       break;
+
+               case CRITIC_SUB_DIV:
+                       print_const("~&gt;");
+                       break;
+
+               case CRITIC_SUB_DIV_A:
+                       print_const("~");
+                       break;
+
+               case CRITIC_SUB_DIV_B:
+                       print_const("&gt;");
+                       break;
+
+               case ESCAPED_CHARACTER:
                        print_const("\\");
                        mmd_print_char_html(out, source[t->start + 1], false);
                        break;
index 2ffde95a334047adfd8998d151fcc6c72c636f90..f811a602b3ed77b95bc7041f8215d29ee6c08b6f 100644 (file)
@@ -1281,6 +1281,9 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size
                        case BLOCK_SETEXT_1:
                        case BLOCK_SETEXT_2:
                        case BLOCK_TABLE:
+                       case BLOCK_TABLE_SECTION:
+                       case TABLE_ROW:
+                       case TABLE_CELL:
                        case BLOCK_TERM:
                        case LINE_LIST_BULLETED:
                        case LINE_LIST_ENUMERATED:
index 1a75d8b67bdefe5300d00c29622e64b43dffd19f..e3fb9d0ad428bee8f3a8dcfd164d87939a0efd4f 100644 (file)
@@ -435,10 +435,10 @@ office:mimetype="application/vnd.oasis.opendocument.text">
 </table:table-row>
 <table:table-row>
 <table:table-cell>
-<text:p text:style-name="MMD-Table"> :&#8212;&#8211; </text:p>
+<text:p text:style-name="MMD-Table"> :&#8212;- </text:p>
 </table:table-cell>
 <table:table-cell>
-<text:p text:style-name="MMD-Table-Right"> &#8212;&#8211;: </text:p>
+<text:p text:style-name="MMD-Table-Right"> &#8212;-: </text:p>
 </table:table-cell>
 </table:table-row>
 <table:table-row>
index 958882d15bcc47c977de37f7e4c734f6d83d07d3..13dde9db8936e2ea411a88810db91af46bac6fbc 100644 (file)
        <td style="text-align:right;"> bar6 </td>
 </tr>
 <tr>
-       <td style="text-align:left;"> :&#8212;&#8211; </td>
-       <td style="text-align:right;"> &#8212;&#8211;: </td>
+       <td style="text-align:left;"> :&#8212;- </td>
+       <td style="text-align:right;"> &#8212;-: </td>
 </tr>
 <tr>
        <td style="text-align:left;"><em>foo</em> </td>
index 6e6d7ba8adad5d19a85aa2a223c31b2cc91657c2..851eb2674e6ea82983ada935c3a73f7932797dfd 100644 (file)
@@ -78,7 +78,7 @@
 \bottomrule
 
  foo6 & bar6 \\
- :----- & -----: \\
+ :---- & ----: \\
 \emph{foo} & \emph{bar} \\
 \multicolumn{2}{l}{ \textbf{foo bar} }\\
 \bottomrule