From 9e06d7d6ac297aa55dd94592d99a50000988343f Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Thu, 7 Apr 2022 15:51:01 -0500 Subject: [PATCH] fix(#340): reset insertion mode on invalid tags when inSelectIM --- .changeset/popular-toys-cough.md | 5 +++++ internal/parser.go | 4 +++- internal/printer/printer_test.go | 7 +++++++ internal/token_test.go | 5 +++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .changeset/popular-toys-cough.md diff --git a/.changeset/popular-toys-cough.md b/.changeset/popular-toys-cough.md new file mode 100644 index 000000000..8e5ca7591 --- /dev/null +++ b/.changeset/popular-toys-cough.md @@ -0,0 +1,5 @@ +--- +'@astrojs/compiler': patch +--- + +Fix #340, fixing behavior of content after an expression inside of ${value && $$render` + BACKTICK + `` + BACKTICK + `}`, }, }, + { + name: "select map expression", + source: `
Hello world!
`, + want: want{ + code: `
Hello world!
`, + }, + }, { name: "textarea", source: `--- diff --git a/internal/token_test.go b/internal/token_test.go index 69edbc99a..87ee69e57 100644 --- a/internal/token_test.go +++ b/internal/token_test.go @@ -336,6 +336,11 @@ func TestBasic(t *testing.T) { `foo`, []TokenType{StartTagToken, TextToken, EndTagToken}, }, + { + "select with expression", + ``, + []TokenType{StartTagToken, StartExpressionToken, TextToken, StartTagToken, StartExpressionToken, TextToken, EndExpressionToken, EndTagToken, TextToken, EndExpressionToken, EndTagToken}, + }, { "Markdown codeblock", fmt.Sprintf(`