strip trailing whitespace from links also if theres no title - smu - smu - simple markup (Markdown) processor (fork, fixes + features)
(HTM) git clone git://git.codemadness.org/smu
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 0b13fa5e1a5eac764db9bbbdff3199aefe1b43e2
(DIR) parent 84c908fb6f3609c25ea60c57c7009490c3c77044
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 11 May 2021 01:48:10 +0200
strip trailing whitespace from links also if theres no title
same as the discount and lowdown Markdown processor
Diffstat:
M smu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/smu.c b/smu.c
@@ -301,7 +301,8 @@ dolink(const char *begin, const char *end, int newblock) {
}
}
else {
- linkend = q;
+ /* strip trailing whitespace */
+ for(linkend = q; linkend > link && isspace(*(linkend - 1)); linkend--);
}
/* Links can be given in angular brackets */