-
Notifications
You must be signed in to change notification settings - Fork 713
fix value property replacement #6147
base: gh-pages
Are you sure you want to change the base?
Conversation
The properties that can have other properties as values can have multiple ones in a list. They were not all getting replaced. I made the fix function use multiline mode, I removed the negative lookahead for a colon (since there can be many), and I handled the case where there is no semi-colon.
Hello, thanks for submitting a PR! Please note that multiline mode makes no difference if you have no What do you mean there can be many colons? The negative lookahead just checks that the property name is not immediately followed by a colon, i.e. it's part of a value. It seems to me that the fix on line 227 would be more than sufficient to fix this bug. |
The multiline mode was needed in my test case, and some of the expressions do have I didn't mean that there could be many colons. I meant that there could be many values after the colon. |
Having multiple values after the colon has nothing to do with what this assertion is preventing. The reason this assertion exists is to avoid looking at properties that are not part of a value, i.e. they are used as properties. I.e. in your declaration, it avoids looking at
That does not follow from the regex. The properties are joined with an OR ( Actually, I just tried |
I was testing with some real CSS that I added more
My test case had more CSS, and it was all handled correctly with this PR, but not without it. I was using Firefox 30 to test, and the |
I tested the original code again, and if there is a space after the property (before the colon), the prefix is not applied. The problem is in my PR also, so I will fix it. But meanwhile, this is the test CSS I am using:
|
Which browser are you testing in? I guess it's Firefox, but if not: This may be better for testing:
So the issues I see are:
All of these fixes are on line 227. |
removed multiline mode restored the negative lookahead for the colon line 227 regex - added whitespace before colon
The properties that can have other properties as values can have multiple ones in a list. They were not all getting replaced.
I made the fix function use multiline mode, I removed the negative lookahead for a colon (since there can be many), and I handled the case where there is no semi-colon.
For #6146