SwiftDocOrg / CommonMark

Create, parse, and render Markdown text according to the CommonMark specification
MIT License
179 stars 10 forks source link

Update to libcmark 0.29.0 #24

Closed mattt closed 3 years ago

mattt commented 3 years ago

Synchronizes with latest from Apple's upstream swift-cmark, which notably includes a change that may resolve the failing test case in #22:

https://github.com/SwiftDocOrg/swift-cmark/commit/1168665f6b36be747ffe6b7b90bc54cfc17f42b7#diff-8a84f48458df6eb6274fc1f0eb3c58d7c8e295ed0873323f99b9567202acc392L146-L149

static bool is_autolink(cmark_node *node) {
     return false;
   }
   cmark_consolidate_text_nodes(link_text);
-  if (strcmp((const char *)url, "mailto:") == 0) {
+  if (strncmp((const char *)url, "mailto:", 7) == 0) {
     url += 7;
   }
-  return strcmp((const char *)url, (char *)link_text->data) == 0;
+  return link_text->data != NULL &&
+         strcmp((const char *)url, (char *)link_text->data) == 0;
 }