summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmark.h6
-rw-r--r--src/inlines.c5
-rw-r--r--src/parser.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/src/cmark.h b/src/cmark.h
index ad9d4c4..102aa6f 100644
--- a/src/cmark.h
+++ b/src/cmark.h
@@ -552,6 +552,12 @@ char *cmark_render_latex(cmark_node *root, int options, int width);
*/
#define CMARK_OPT_HARDBREAKS (1 << 2)
+/** `CMARK_OPT_SAFE` is defined here for API compatibility,
+ but it no longer has any effect. "Safe" mode is now the default:
+ set `CMARK_OPT_UNSAFE` to disable it.
+ */
+#define CMARK_OPT_SAFE (1 << 3)
+
/** Render raw HTML and unsafe links (`javascript:`, `vbscript:`,
* `file:`, and `data:`, except for `image/png`, `image/gif`,
* `image/jpeg`, or `image/webp` mime types). By default,
diff --git a/src/inlines.c b/src/inlines.c
index dc899dc..6f93fd4 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -642,7 +642,8 @@ static void process_emphasis(subject *subj, delimiter *stack_bottom) {
// interior closer of size 2 can't match opener of size 1
// or of size 1 can't match 2
if (!(closer->can_open || opener->can_close) ||
- ((opener->length + closer->length) % 3) != 0) {
+ closer->length % 3 == 0 ||
+ (opener->length + closer->length) % 3 != 0) {
opener_found = true;
break;
}
@@ -966,7 +967,7 @@ static bufsize_t manual_scan_link_url(cmark_chunk *input, bufsize_t offset,
} else if (input->data[i] == '\\')
i += 2;
else if (input->data[i] == '\n' || input->data[i] == '<')
- return manual_scan_link_url_2(input, offset, output);
+ return -1;
else
++i;
}
diff --git a/src/parser.h b/src/parser.h
index 7f8ac9d..39e2327 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -2,6 +2,7 @@
#define CMARK_AST_H
#include <stdio.h>
+#include "references.h"
#include "node.h"
#include "buffer.h"
#include "memory.h"