Skip to content

<code> tag is not recognized #60

@manfredjb

Description

@manfredjb

This is the HTML:

<strong>hello</strong>
<code class="language-php">$foo = "bar";</code>

The parser only recognizes <strong> according to the output:

there are 1 nodes

  • strong
$dom = new Dom;
$dom->load('<strong>hello</strong><code class="language-php">$foo = "bar";</code>');
$nodes = $dom->find('*');
$total = count($nodes);
echo "there are {$total} nodes";
/** @var Dom\AbstractNode $node*/
foreach ($nodes as $node) {
    $tag = $node->getTag();
    echo "<br>- {$tag->name()}";
}

Any idea why <code> is ignored? I have tested a lot of tags and only this one is not recognized. Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions