PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

bug with parsing multiple comments

Open snake opened this issue 6 years ago • 0 comments

When parsing a rule or csslist, trailing comments (those comments after the rule/list) are consumed as part of a final consumeWhitespace call, meaning we don't see these reported for the next rule in the set (or the next set).

Consider the following cases:

div {/*Find Me!*/left:10px; /*Find Me Too!*/text-align:left;} Both of these comments should be returned (one for each rule), but the latter is not.

/*Find Me!*/div {left:10px; text-align:left;} /*Find Me Too!*/a {left:10px;} Both of these comments should be returned (one for each csslist), but the latter is not.

I'd like this fixed so I can use this to parse RTL directives for css rules/lists reliably again. Moodle recently upgraded to 8.3.0 and this broke our RTL.

Please see the linked fix proposal.

snake avatar Nov 04 '19 02:11 snake