From 624bbe57340005ec52c329c79cafee3420cb1ebc Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 21 Dec 2023 14:52:29 -0600 Subject: [PATCH] fix: handle strings before elements --- internal/token.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/token.go b/internal/token.go index 5a58e1f79..8a0531966 100644 --- a/internal/token.go +++ b/internal/token.go @@ -1879,6 +1879,14 @@ frontmatter_loop: return z.tt } + // handle string + if c == '\'' || c == '"' || c == '`' { + z.readString(c) + z.tt = TextToken + z.data.End = z.raw.End + return z.tt + } + s := z.buf[z.raw.Start : z.raw.Start+1][0] if s == '<' || s == '{' || s == '}' || c == '<' || c == '{' || c == '}' { @@ -1892,14 +1900,6 @@ frontmatter_loop: } } - // handle string - if c == '\'' || c == '"' || c == '`' { - z.readString(c) - z.tt = TextToken - z.data.End = z.raw.End - return z.tt - } - z.dashCount = 0 continue frontmatter_loop }