Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Fix multiline parsing issues fixes #174 #281

Merged
merged 1 commit into from
Apr 23, 2021

Conversation

jasonwilliams
Copy link
Collaborator

@jasonwilliams jasonwilliams commented Apr 23, 2021

For the TLDR see before and after below...

The issue was with the main regex, specially the beginning match, which only matches an expression which ends with a back tick. When you use multiline properties your top line no longer ends the same way (styled.div<{). This means we need to set a new beginning match. I tried doing this as a new rule but it just didn't work, instead I split the regex into 2 (non-captured) groups and the second group matches:

}>`

and sets that as the beginning match, so anything after the above will be treated as SCSS, up until the next backtick

* create a multiline fixture from issue styled-components#174
* Fixed by creating two groups, one which was the same as before, and one which adds support for }>` syntax as the beginning. Tests have passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant