marko-js / htmljs-parser

An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values
MIT License
135 stars 20 forks source link

fix: ensure unary expression continuation is a word boundary #156

Closed DylanPiercey closed 1 year ago

DylanPiercey commented 1 year ago

Description

Fix regression where the parser would continue unary keyword expressions even if the keyword was inside a word boundary. Eg <div class=thing_new x> would cause the parser to see the expression as thing_ and new x.

Checklist:

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 73eb906b29a091c0a81713a62a58a5a0137efb3f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------- | ----- | | htmljs-parser | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (785a593) 93.43% compared to head (73eb906) 93.43%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #156 +/- ## ======================================= Coverage 93.43% 93.43% ======================================= Files 26 26 Lines 1279 1280 +1 Branches 291 291 ======================================= + Hits 1195 1196 +1 Misses 54 54 Partials 30 30 ``` | [Impacted Files](https://codecov.io/gh/marko-js/htmljs-parser/pull/156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js) | Coverage Δ | | |---|---|---| | [src/states/EXPRESSION.ts](https://codecov.io/gh/marko-js/htmljs-parser/pull/156?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js#diff-c3JjL3N0YXRlcy9FWFBSRVNTSU9OLnRz) | `93.54% <100.00%> (+0.04%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.