commit 0b13fa5e1a5eac764db9bbbdff3199aefe1b43e2
parent 84c908fb6f3609c25ea60c57c7009490c3c77044
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:
1 file changed, 2 insertions(+), 1 deletion(-)
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 */