scrivo / highlight.php

A port of highlight.js by Ivan Sagalaev to PHP
BSD 3-Clause "New" or "Revised" License
695 stars 45 forks source link

PHP code seems to be insufficiently tagged. #98

Open ShawnMcCool opened 2 years ago

ShawnMcCool commented 2 years ago
echo $this->highlighter
    ->highlight(
        'php',
        <<<'CODE'
        <?php

        $high = $dog->cat();
        $dog = new Cat();
        CODE
    )
    ->value;

This code echos:

<span class="hljs-meta">&lt;?php</span>

$high = $dog-&gt;cat();
$dog = <span class="hljs-keyword">new</span> Cat();

Is there something that I'm doing wrong that prevents.. for example.. the class name to be wrapped in a span? Only the 'new' keyword and '<?php' meta seems to be specified.