Skip to content

feat(html): add various helpers to html syntax nodes#8804

Merged
ematipico merged 1 commit intomainfrom
dyc3/html-element-helpers
Jan 19, 2026
Merged

feat(html): add various helpers to html syntax nodes#8804
ematipico merged 1 commit intomainfrom
dyc3/html-element-helpers

Conversation

@dyc3
Copy link
Copy Markdown
Contributor

@dyc3 dyc3 commented Jan 19, 2026

Summary

Adds some useful helpers to HTML syntax nodes, mostly to make it easier to extract the tag name without a bunch of code.

These helpers will be used later in this stack of PRs.

Test Plan

CI should be green

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 19, 2026

⚠️ No Changeset found

Latest commit: 9465485

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Copy Markdown
Contributor Author

dyc3 commented Jan 19, 2026

@github-actions github-actions Bot added A-Parser Area: parser L-HTML Language: HTML and super languages labels Jan 19, 2026
@dyc3 dyc3 requested review from a team January 19, 2026 13:33
@dyc3 dyc3 marked this pull request as ready for review January 19, 2026 13:33
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 19, 2026

Walkthrough

This pull request extends the HTML syntax API with tag-name accessors and element introspection utilities. New tag_name() methods are added to HtmlSelfClosingElement, HtmlOpeningElement, and HtmlElement to retrieve element names. The AnyHtmlElement enum receives updated and new methods: name() is refactored to delegate to the corresponding tag_name() variants, closing_r_angle_token() provides access to closing angle tokens for standard HTML elements, and Svelte-specific utilities is_svelte_block() and as_svelte_block() enable type checking and conversion for Svelte blocks. Corresponding imports are updated to support these additions.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding helper methods to HTML syntax nodes for easier tag name extraction and other utilities.
Description check ✅ Passed The description clearly explains the motivation (simplifying tag name extraction), mentions these helpers will be used in subsequent PRs, and references CI validation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Looks good!

@ematipico ematipico merged commit cf51ad3 into main Jan 19, 2026
15 checks passed
@ematipico ematipico deleted the dyc3/html-element-helpers branch January 19, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Parser Area: parser L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants