aboutsummaryrefslogtreecommitdiff
path: root/markdown/ast_external.go
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-10-03 22:15:12 +0200
committerWilliam Hergès <william@herges.fr>2025-10-03 22:15:12 +0200
commitce6a2da035dc045510157a0eeefaebf56f0e8958 (patch)
tree47d6dca601372c110681a301f25f05279e456523 /markdown/ast_external.go
parent9644afb7552d1b030beea6c8794f4419b9c686fe (diff)
fix(markdown): external source never stopped
Diffstat (limited to 'markdown/ast_external.go')
-rw-r--r--markdown/ast_external.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/markdown/ast_external.go b/markdown/ast_external.go
index a172b2b..ea78450 100644
--- a/markdown/ast_external.go
+++ b/markdown/ast_external.go
@@ -119,7 +119,7 @@ func parseExternal(lxs *lexers, withSource bool) (string, string, []*astParagrap
return "", "", nil, false
}
n += len(lxs.Current().Value)
- if first != "" && end != "" {
+ if n < 2 && first != "" && end != "" {
if !lxs.Next() {
return first, end, ps, true
}
@@ -127,8 +127,8 @@ func parseExternal(lxs *lexers, withSource bool) (string, string, []*astParagrap
if !ok {
return "", "", nil, false
}
- lxs.Before() // because we must parse lexerBreak
}
+ lxs.Before() // because we must parse lexerBreak and the next call must parse the next value
case lexerExternal:
if first != "" && end != "" {
return "", "", nil, false