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

Avoid regexp for expression continuations #130

Closed DylanPiercey closed 2 years ago

DylanPiercey commented 2 years ago

Switch from regexp based parsing for the expression continuations. This slightly improves performance and more importantly fixes usage of the parser in safari.

changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: f923c5e9e1af8cda5c2e55df25ba0e370465faf1

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 2 years ago

Codecov Report

Merging #130 (f923c5e) into main (250c17b) will decrease coverage by 0.48%. The diff coverage is 93.52%.

@@            Coverage Diff             @@
##             main     #130      +/-   ##
==========================================
- Coverage   92.51%   92.02%   -0.49%     
==========================================
  Files          26       26              
  Lines         735      803      +68     
  Branches      244      268      +24     
==========================================
+ Hits          680      739      +59     
- Misses         40       49       +9     
  Partials       15       15              
Impacted Files Coverage Δ
src/states/PLACEHOLDER.ts 100.00% <ø> (ø)
src/util/constants.ts 100.00% <ø> (ø)
src/states/TEMPLATE_STRING.ts 69.23% <71.42%> (-14.11%) :arrow_down:
src/states/OPEN_TAG.ts 88.54% <75.00%> (-2.22%) :arrow_down:
src/states/ATTRIBUTE.ts 92.94% <91.66%> (-2.06%) :arrow_down:
src/states/EXPRESSION.ts 91.93% <98.66%> (+2.40%) :arrow_up:
src/states/INLINE_SCRIPT.ts 100.00% <100.00%> (ø)
src/states/TAG_NAME.ts 100.00% <100.00%> (ø)
src/util/util.ts 87.50% <100.00%> (+1.78%) :arrow_up:
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.