Skip to content

Commit

Permalink
Revert "Prevent reading apostrophes as a string (#84)" (#87)
Browse files Browse the repository at this point in the history
* Revert "Prevent reading apostrophes as a string (#84)"

This reverts commit ef7cb1e.

* Adds a changeset
  • Loading branch information
matthewp authored Oct 22, 2021
1 parent 9748a5b commit 27629b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-bats-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/compiler': patch
---

Reverts the apostrophe change that broke markdown parsing
14 changes: 5 additions & 9 deletions internal/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -1336,15 +1336,11 @@ loop:
return z.tt
}

if z.tt != StartTagToken {
// Does this need to exist at all?
// Expressions and frontmatter have their own loop
if c == '\'' || c == '"' || c == '`' {
z.readString(c)
z.tt = TextToken
z.data.End = z.raw.End
return z.tt
}
if c == '\'' || c == '"' || c == '`' {
z.readString(c)
z.tt = TextToken
z.data.End = z.raw.End
return z.tt
}

if c == '{' || c == '}' {
Expand Down
5 changes: 0 additions & 5 deletions internal/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ func TestBasic(t *testing.T) {
`<div>{ value }</div>`,
[]TokenType{StartTagToken, StartExpressionToken, TextToken, EndExpressionToken, EndTagToken},
},
{
"quotes within textContent",
`<p>can't</p>`,
[]TokenType{StartTagToken, TextToken, EndTagToken},
},
}

runTokenTypeTest(t, Basic)
Expand Down

0 comments on commit 27629b2

Please sign in to comment.