cmark

My personal build of CMark ✏️

Commit
1ea9cd8ceaec181dd945d82af812a7712f232573
Parent
88c8ad11b687c756146d27d31b5a30f3cf13a75e
Author
John MacFarlane <jgm@berkeley.edu>
Date

Reverted mistaken fix to #193.

Commit 14ea489f5dd6e3d07e23f104d6c9ce441d05751b

Diffstat

3 files changed, 36 insertions, 26 deletions

Status File Name N° Changes Insertions Deletions
Modified src/scanners.c 58 34 24
Modified src/scanners.re 2 1 1
Modified test/regression.txt 2 1 1
diff --git a/src/scanners.c b/src/scanners.c
@@ -752,7 +752,7 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
         0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
         0,   0,   0,   0,   0,   128, 128, 128, 128, 128, 128, 128, 128, 128,
         128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
-        128, 128, 128, 128, 128, 128, 0,   128, 128, 128, 128, 128, 128, 128,
+        128, 128, 128, 128, 0,   128, 0,   128, 128, 128, 128, 128, 128, 128,
         128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
         128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
         128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
@@ -839,7 +839,7 @@ bufsize_t _scan_autolink_uri(const unsigned char *p) {
     }
     if (yych <= 0xEC) {
       if (yych <= 0xC1) {
-        if (yych <= ' ')
+        if (yych <= '<')
           goto yy45;
         if (yych <= '>')
           goto yy85;
@@ -7887,35 +7887,45 @@ bufsize_t _scan_html_tag(const unsigned char *p) {
     unsigned char yych;
     static const unsigned char yybm[] = {
         /* table 1 .. 8: 0 */
-        0, 239, 239, 239, 239, 239, 239, 239, 239, 238, 238, 238, 238, 238, 239,
+        0,   239, 239, 239, 239, 239, 239, 239, 239, 238, 238, 238, 238, 238,
         239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
-        239, 239, 239, 238, 239, 234, 239, 239, 239, 239, 236, 239, 239, 239,
-        239, 239, 207, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
-        239, 239, 239, 238, 238, 174, 231, 239, 255, 255, 255, 255, 255, 255,
+        239, 239, 239, 239, 238, 239, 234, 239, 239, 239, 239, 236, 239, 239,
+        239, 239, 239, 207, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
+        239, 239, 239, 239, 238, 238, 174, 231, 239, 255, 255, 255, 255, 255,
         255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
-        255, 255, 255, 255, 255, 255, 239, 239, 111, 239, 239, 238, 239, 239,
+        255, 255, 255, 255, 255, 255, 255, 239, 239, 111, 239, 239, 238, 239,
         239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
         239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
-        239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        239, 239, 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,
         /* table 9 .. 11: 256 */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        160, 128, 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 128, 0,
-        0, 0, 0, 0, 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   64,  64,  64,  64,  64,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   64,  0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   160, 128, 0,   160, 160, 160, 160, 160, 160, 160, 160,
+        160, 160, 128, 0,   0,   0,   0,   0,   0,   160, 160, 160, 160, 160,
         160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
-        160, 0, 0, 0, 0, 128, 0, 160, 160, 160, 160, 160, 160, 160, 160, 160,
+        160, 160, 160, 160, 160, 160, 160, 0,   0,   0,   0,   128, 0,   160,
         160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
-        160, 160, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+        0,   0,   0,   0,
     };
     yych = *p;
     if (yych <= '>') {
diff --git a/src/scanners.re b/src/scanners.re
@@ -91,7 +91,7 @@ bufsize_t _scan_autolink_uri(const unsigned char *p)
   const unsigned char *marker = NULL;
   const unsigned char *start = p;
 /*!re2c
-  scheme [:][^\x00-\x20>]*[>]  { return (bufsize_t)(p - start); }
+  scheme [:][^\x00-\x20<>]*[>]  { return (bufsize_t)(p - start); }
   * { return 0; }
 */
 }
diff --git a/test/regression.txt b/test/regression.txt
@@ -81,7 +81,7 @@ Issue #193 - unescaped left angle brackets in link destination
 
 [a]: <te<st>
 .
-<p><a href="te%3Cst">a</a></p>
+<p><a href="%3Cte%3Cst%3E">a</a></p>
 ````````````````````````````````
 
 Issue #192 - escaped spaces in link destination