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

CSS uses /* not // #30

Merged
merged 1 commit into from
Nov 22, 2021
Merged

CSS uses /* not // #30

merged 1 commit into from
Nov 22, 2021

Conversation

dhh
Copy link
Member

@dhh dhh commented Nov 22, 2021

No description provided.

@dhh dhh merged commit 28119eb into main Nov 22, 2021
@dhh dhh deleted the use-correct-comment-for-css-source-maps branch November 22, 2021 16:08
@@ -3,14 +3,14 @@
class Propshaft::Compilers::SourceMappingUrls
attr_reader :assembly

SOURCE_MAPPING_PATTERN = /\/\/# sourceMappingURL=(.*\.map)/
SOURCE_MAPPING_PATTERN = /(\/\/|\/*)# sourceMappingURL=(.*\.map)/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since * is a special character in Regexps (the "zero or more" quantifier), it needs to be escaped when we want to match a literal *. As a result, this pattern isn't as restrictive as we want it to be (it'll match # sourceMappingURL= even when it doesn't appear in a CSS comment). I've opened #32 to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants