diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-25 07:54:05 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-26 06:21:54 +0200 |
commit | 1ef6a1abe1b0a5f6fc04f44a73ede0c47ca6885b (patch) | |
tree | 61782f64cb3d8df69e7a6a73554c059e35be6126 | |
parent | 0e41c654ec0e1cfc6c4f30d90551a9722c727489 (diff) |
GmDocument: Detect an invalid link
IssueID #427
# Conflicts:
# res/about/version.gmi
-rw-r--r-- | src/gmdocument.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) { | |||
238 | return text_GmLineType; | 238 | return text_GmLineType; |
239 | } | 239 | } |
240 | if (startsWith_Rangecc(line, "=>")) { | 240 | if (startsWith_Rangecc(line, "=>")) { |
241 | return link_GmLineType; | 241 | iRangecc trim = line; |
242 | trim_Rangecc(&trim); | ||
243 | if (size_Range(&trim) > 2) { | ||
244 | return link_GmLineType; | ||
245 | } | ||
246 | return text_GmLineType; | ||
242 | } | 247 | } |
243 | if (startsWith_Rangecc(line, "###")) { | 248 | if (startsWith_Rangecc(line, "###")) { |
244 | return heading3_GmLineType; | 249 | return heading3_GmLineType; |