summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/inlines.c4
-rw-r--r--test/regression.txt8
2 files changed, 11 insertions, 1 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 021d5a3..eea0631 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -842,7 +842,9 @@ static bufsize_t manual_scan_link_url(cmark_chunk *input, bufsize_t offset) {
}
} else {
while (i < input->len) {
- if (input->data[i] == '\\')
+ if (input->data[i] == '\\' &&
+ i + 1 < input-> len &&
+ cmark_ispunct(input->data[i+1]))
i += 2;
else if (input->data[i] == '(') {
++nb_p;
diff --git a/test/regression.txt b/test/regression.txt
index ebc31bc..18b7d79 100644
--- a/test/regression.txt
+++ b/test/regression.txt
@@ -84,3 +84,11 @@ Issue #193 - unescaped left angle brackets in link destination
<p><a href="te%3Cst">a</a></p>
````````````````````````````````
+Issue #192 - escaped spaces in link destination
+
+
+```````````````````````````````` example
+[a](te\ st)
+.
+<p>[a](te\ st)</p>
+````````````````````````````````