Handle missing quotes and leading slashes#7
Open
simonewebdesign wants to merge 4 commits intomahhov:masterfrom
Open
Handle missing quotes and leading slashes#7simonewebdesign wants to merge 4 commits intomahhov:masterfrom
simonewebdesign wants to merge 4 commits intomahhov:masterfrom
Conversation
mahhov
requested changes
May 19, 2021
Owner
mahhov
left a comment
There was a problem hiding this comment.
This is great, thanks for the pull request.
1 minor comment; otherwise looks good to me.
|
|
||
| let inlineImages = async htmlPath => { | ||
| const imgTagRegex = /<img (.* )?src="([\w.\-\/]+)"(.*)>/; | ||
| const imgTagRegex = /<img (.* )?src="?([\w.\-\/]+)"?(.*)>/; |
Owner
There was a problem hiding this comment.
If we're going to relax this, then we may as well include single quotes as well.
Specifically, here and in the other files, replace "? with ['"]?
Contributor
Author
There was a problem hiding this comment.
Hey @mahhov, sorry I didn't get back to you on this. I think my change actually breaks in some cases (can't recall the exact problem now) - it happened to work fine on my minified stylesheet, but didn't really test other cases. Merging this PR at the current state is probably not a good idea, unless I dig into the problem and add some more tests!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I made a couple of improvements to make the scripts work with minified files, which don't have double quotes around HTML attribute values.
Also handled paths with leading slashes by just removing them (not sure if this is a good idea in general, but it does work for my use case).
Finally I deleted
bundled.htmlas it looks like it was committed accidentally :)