Skip to content

Commit 624bbe5

Browse files
committed
fix: handle strings before elements
1 parent 091e365 commit 624bbe5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

internal/token.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,14 @@ frontmatter_loop:
18791879
return z.tt
18801880
}
18811881

1882+
// handle string
1883+
if c == '\'' || c == '"' || c == '`' {
1884+
z.readString(c)
1885+
z.tt = TextToken
1886+
z.data.End = z.raw.End
1887+
return z.tt
1888+
}
1889+
18821890
s := z.buf[z.raw.Start : z.raw.Start+1][0]
18831891

18841892
if s == '<' || s == '{' || s == '}' || c == '<' || c == '{' || c == '}' {
@@ -1892,14 +1900,6 @@ frontmatter_loop:
18921900
}
18931901
}
18941902

1895-
// handle string
1896-
if c == '\'' || c == '"' || c == '`' {
1897-
z.readString(c)
1898-
z.tt = TextToken
1899-
z.data.End = z.raw.End
1900-
return z.tt
1901-
}
1902-
19031903
z.dashCount = 0
19041904
continue frontmatter_loop
19051905
}

0 commit comments

Comments
 (0)