Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve js style comment support #119

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

DylanPiercey
Copy link
Contributor

@DylanPiercey DylanPiercey commented Jul 8, 2022

Description

Adds better support for line comments within the open tag, eg:

<div class="foo" // this class is important
    onClick() {} // does stuff
>

This PR also makes the slightly breaking change of supporting JS style comments (both //line and /*block*/) within html content.

This means you can now do:

<div>
  // This is a comment
  This is not
 </div>

Previously you could only use js style comments within concise mode.

Checklist:

  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2022

🦋 Changeset detected

Latest commit: e1212f0

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
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #119 (e1212f0) into main (112cf54) will increase coverage by 0.15%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   93.44%   93.59%   +0.15%     
==========================================
  Files          26       26              
  Lines         717      734      +17     
  Branches      248      254       +6     
==========================================
+ Hits          670      687      +17     
  Misses         32       32              
  Partials       15       15              
Impacted Files Coverage Δ
src/states/HTML_CONTENT.ts 97.61% <100.00%> (+1.32%) ⬆️
src/states/OPEN_TAG.ts 94.65% <100.00%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 112cf54...e1212f0. Read the comment docs.

@DylanPiercey DylanPiercey merged commit 28fde07 into main Jul 8, 2022
@DylanPiercey DylanPiercey deleted the support-js-comments-in-body branch July 8, 2022 22:05
@github-actions github-actions bot mentioned this pull request Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant