Skip to content

Should DOM tokenizer fail at missing whitespace between attributes? #17833

@NicTorgersen

Description

@NicTorgersen

Description

The following code:

<?php

use Dom\HTMLDocument;

HTMLDocument::createFromString('<svg xmlns="http://www.w3.org/2000/svg"width="24"height="24"fill="none"viewBox="0 0 24 24" part="w-icon-circle-plus-24-part">')

Resulted in this output:

Dom\HTMLDocument::createFromString(): tokenizer error missing-whitespace-between-attributes in ...

I know it's not "correct" markup, but in Firefox this is correctly parsed and working. The error is thrown from php-src/ext/dom/lexbor/lexbor/html/tokenizer/state_doctype.c:184.

PHP Version

PHP 8.4.4

Operating System

MacOS Sequioa 15.3.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions