Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: escape / exclude scripts with unknown types #1026

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: order
  • Loading branch information
Princesseuh committed Jul 17, 2024
commit 1b52a71f6a9bcdf171a490b655c13f6202339805
2 changes: 1 addition & 1 deletion internal/printer/print-to-tsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ declare const Astro: Readonly<import('astro').AstroGlobal<%s, typeof %s`, propsI
p.addSourceMapping(loc.Loc{Start: n.Loc[0].Start + len(n.Data)})
} else if textType == StyleText || textType == JsonScriptText || textType == RawText || textType == UnknownScriptText {
p.addNilSourceMapping()
if (textType == StyleText && o.IncludeStyles) || ((textType == JsonScriptText || textType == RawText || textType == UnknownScriptText) && o.IncludeScripts) {
if (textType == StyleText && o.IncludeStyles) || ((textType == JsonScriptText || textType == UnknownScriptText) && o.IncludeScripts) || textType == RawText {
p.print("{`")
p.printTextWithSourcemap(escapeText(n.Data), n.Loc[0])
p.addNilSourceMapping()
Expand Down