Skip to content

Conversation

yeonjuan
Copy link
Owner

fixes #28

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.91%. Comparing base (7d1dd41) to head (994aca3).

Additional details and impacted files
@@            Coverage Diff            @@
##           main      #31       +/-   ##
=========================================
+ Coverage      0   94.91%   +94.91%     
=========================================
  Files         0       56       +56     
  Lines         0     1140     +1140     
  Branches      0      163      +163     
=========================================
+ Hits          0     1082     +1082     
- Misses        0       58       +58     
Flag Coverage Δ
unittest 94.91% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/tokenizer/handlers/attributes.ts 100.00% <100.00%> (ø)
src/utils/raise.ts 100.00% <100.00%> (ø)

... and 54 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yeonjuan yeonjuan requested a review from Copilot April 25, 2025 14:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses issue #28 by introducing a new error function to raise a SyntaxError when a closing token is missing. Key changes include:

  • Introducing the raise() function in src/utils/raise.ts
  • Integrating raise() into the tokenizer attribute handler in src/tokenizer/handlers/attributes.ts to detect missing closing tokens
  • Adding a test case in src/tokenizer/tests/tokenize.spec.ts for parsing error handling

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/raise.ts New function to raise a SyntaxError with precise location info
src/utils/index.ts Updated exports to include the new raise() function
src/tokenizer/handlers/attributes.ts Uses raise() to error on missing closing tag
src/tokenizer/tests/tokenize.spec.ts Adds test coverage for the new error when closing token is absent
src/tokenizer/tests/input/parsing-error-no-open-end.html Provides test input to trigger the error

@yeonjuan yeonjuan merged commit a9de039 into main Apr 25, 2025
3 checks passed
@yeonjuan yeonjuan deleted the error branch April 25, 2025 14:01
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.

es-html-parser should crash on invalid input
2 participants