Skip to content

Use DOM Parser for transformHtmlTemplate #578

Closed

Description

@littleboarx

Environment

v24.4.0

Reproduction

see:
https://github.com/littleboarx/unhead/blob/bug/dom-attrs/packages/unhead/test/unit/server/extractUnheadInputFromHtml.test.ts

Describe the bug

test output:
AssertionError: expected { 'data-vue': true, …(2) } to deeply equal { 'data-vue-ssr-id': '12345678' }

Additional context

Suggest a solution: use DOM parser instead of regex parser

Logs

Activity

  1. harlan-zw commented on Sep 17, 2025

    @harlan-zw
    Collaborator

    Thanks for the test case! I've pushed up a fix for the regex, I'd like to use a DOM Parser but I want to avoid any dependencies for now. So will consider this for the next major, will keep open to track that.

  2. changed the title [-]transformHtmlTemplate incorrect attrs parse[/-] [+]Use DOM Parser for transformHtmlTemplate[/+] on Sep 17, 2025
  3. harlan-zw commented on Sep 18, 2025

    @harlan-zw
    Collaborator

    Okay I changed my mind 😛 walker is now implemented

  4. added a commit that references this issue on Dec 17, 2025
    e23dbac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions