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

Add remove() and isRemoved in HTMLRewriterTypes.Doctype interface #16031

Merged
merged 3 commits into from
Dec 29, 2024

Conversation

Devanand-Sharma
Copy link
Contributor

What does this PR do?

Resolves #16020

This adds remove() method and removed property to the DOCTYPE handler in HTMLRewriter. These APIs were added in lol-html v0.3.3 but were not accessible through Bun's HTMLRewriter bindings.

  • Documentation or TypeScript types
  • Code changes

How did you verify your code works?

For Zig files changed:

  • I checked the lifetime of memory allocated to verify it's (1) freed and (2) only freed when it should be
  • I included a test for the new code: test/js/web/html/html-rewriter-doctype.test.ts
  • JSValue used outside outside of the stack is either wrapped in a JSC.Strong or is JSValueProtect'ed
  • I wrote TypeScript/JavaScript tests and they pass locally
  • I added TypeScript types for the new methods and getter

@Devanand-Sharma Devanand-Sharma marked this pull request as ready for review December 28, 2024 17:47
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner left a comment

Choose a reason for hiding this comment

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

Looks great. Thank you

@Jarred-Sumner Jarred-Sumner merged commit 18ac7f9 into oven-sh:main Dec 29, 2024
1 check was pending
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.

Add remove() and isRemoved in HTMLRewriterTypes.Doctype interface
2 participants