From 1ef6a1abe1b0a5f6fc04f44a73ede0c47ca6885b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 25 Dec 2021 07:54:05 +0200 Subject: GmDocument: Detect an invalid link IssueID #427 # Conflicts: # res/about/version.gmi --- src/gmdocument.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gmdocument.c b/src/gmdocument.c index 0197ed99..fd13bc82 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c @@ -238,7 +238,12 @@ enum iGmLineType lineType_Rangecc(const iRangecc line) { return text_GmLineType; } if (startsWith_Rangecc(line, "=>")) { - return link_GmLineType; + iRangecc trim = line; + trim_Rangecc(&trim); + if (size_Range(&trim) > 2) { + return link_GmLineType; + } + return text_GmLineType; } if (startsWith_Rangecc(line, "###")) { return heading3_GmLineType; -- cgit v1.2.3