-
Notifications
You must be signed in to change notification settings - Fork 67
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(tsx): prevent slashes in html comment from causing premature closing of comments in the tsx output #929
Conversation
🦋 Changeset detectedLatest commit: 6f8eac9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -217,6 +217,10 @@ declare const Astro: Readonly<import('astro').AstroGlobal<%s, typeof %s`, propsI | |||
// p.addSourceMapping(n.Loc[0]) | |||
p.addNilSourceMapping() | |||
p.print("{/**") | |||
if !unicode.IsSpace(rune(n.Data[0])) { | |||
// always add a space after the opening comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to this approach would be to just escape all slashes in the comment
!preview escaped-slash-tsx |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm!
Changes
*/
into*\/
Testing
Added TS tests:
*/
Docs
N/A bug fix only