summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Bartel <karl42@gmail.com>2019-09-29 18:46:41 +0200
committerEnno Boland <g@s01.de>2020-07-01 08:56:22 +0200
commit68edb1b8fdf4596a379712264e23d6412ff41ddb (patch)
tree0cfa6db5dc55be4bf891248e8e679153979a109b
parenta9636129ccb0ee70d2795ad05c41770ba57aae73 (diff)
Support literal quotes in titles
I could not find this in the markdown spec, but https://github.com/michelf/mdtest/blob/master/Markdown.mdtest/Literal%20quotes%20in%20titles.text includes it in the test suite and I actually prefer the implementation after this change.
-rw-r--r--smu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/smu.c b/smu.c
index 2b9e8fc..b6d10fa 100644
--- a/smu.c
+++ b/smu.c
@@ -277,9 +277,10 @@ dolink(const char *begin, const char *end, int newblock) {
title = p + 1;
/* strip trailing whitespace */
for(linkend = p; linkend > link && isspace(*(linkend - 1)); linkend--);
- if(!(p = strchr(title, sep)) || q > end || p > q)
+ for(titleend = q - 1; titleend > link && isspace(*(titleend)); titleend--);
+ if(*titleend != sep) {
return 0;
- titleend = p;
+ }
}
else {
linkend = q;