borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
558 stars 18 forks source link

Nested template literals break highlighting in a big way #169

Closed acnebs closed 6 years ago

acnebs commented 6 years ago

If you have nested template literals, code highlighting is broken for all subsequent code. The example below is perfectly valid code and compiles just fine, but breaks syntax highlighting in the rest of the file.

const Tab = styled.div`
  color: blue;
`

const Tabs = styled.div`
  ${props => props.vertical && css`
    ${Tab} {
      color: red;
    }
  `}
`

Here is a screenshot.

screen shot 2018-08-15 at 11 55 58 am
borela commented 6 years ago

Fixed in https://github.com/borela/naomi/releases/tag/v4.2.1 If the patch didn't work or it still breaks in another case, feel free to reopen or post a new issue;

pedroscaff commented 5 years ago

I have a similar issue, the patch works for the case above but when there is a . in front of the template literals, it breaks the highlighting.

image

Removing the .

image

Should I open a new issue or is it possible to reopen this issue?

borela commented 5 years ago

@pedroscaff Please open a new issue with the minimum reproducible sample.