Skip to content

Conversation

yeonjuan
Copy link
Owner

No description provided.

@yeonjuan yeonjuan requested a review from Copilot July 29, 2025 13:28
@yeonjuan yeonjuan marked this pull request as ready for review July 29, 2025 13:28
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 introduces support for raw content tokens and nodes, allowing the parser to handle content that should be preserved without additional processing or interpretation. This is useful for custom tags that contain raw markup like Markdown or code blocks.

  • Adds RawContent token and node types to distinguish from regular text content
  • Updates tokenizer to emit RawContent tokens instead of Text tokens for custom tag content
  • Implements tree construction handling for raw content nodes

Reviewed Changes

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

Show a summary per file
File Description
src/constants/token-types.ts Adds RawContent token type enum
src/constants/node-types.ts Adds RawContent node type enum
src/types/token.ts Updates AnyToken union to include RawContent composite token
src/types/node.ts Adds RawContentNode type and updates node children arrays
src/tokenizer/handlers/custom-tag-raw-content.ts Changes tokenizer to emit RawContent instead of Text tokens
src/tree-constructor/handlers/tag-content.ts Adds handler for RawContent tokens in tree construction
src/tokenizer/tests/output/custom-tag-raw-content.ts Updates test output to reflect RawContent token type
src/tree-constructor/tests/construct-tree.spec.ts Adds test case for custom tag raw content
src/tree-constructor/tests/file_snapshots/construct-tree-Custom-Tag-Raw-Content-0.json Snapshot file for raw content test case
src/index.ts Exports Options type from parse types

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.08%. Comparing base (ab87f37) to head (014baf9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
+ Coverage   95.05%   95.08%   +0.03%     
==========================================
  Files          57       57              
  Lines        1172     1180       +8     
  Branches      172      173       +1     
==========================================
+ Hits         1114     1122       +8     
  Misses         58       58              
Flag Coverage Δ
unittest 95.08% <100.00%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
src/tokenizer/handlers/custom-tag-raw-content.ts 100.00% <ø> (ø)
src/tree-constructor/handlers/tag-content.ts 94.73% <100.00%> (+0.61%) ⬆️
🚀 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 merged commit 3f2104b into main Jul 29, 2025
3 checks passed
@yeonjuan yeonjuan deleted the add-raw-content-type branch July 29, 2025 13:29
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.

2 participants