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 comments #104

Closed nam-co closed 1 year ago

nam-co commented 1 year ago

Thanks for the package, in many ways is better to hable code with php than js, Im having some problems hope you can help me, I trying this code but it doesn't divide into tags anything

<code class="hljs php">
// Instantiate the Highlighter.
$hl = new \Highlight\Highlighter();
$code = file_get_contents('some_ruby_script.rb');
</code>
Screenshot 2023-02-07 at 9 08 28 AM
nam-co commented 1 year ago

Hope you can help me

nam-co commented 1 year ago

This is what I get when I inspect the code element

Screenshot 2023-02-07 at 9 11 02 AM
S1SYPHOS commented 1 year ago

I don't see any echo statement? 🤔

nam-co commented 1 year ago

the echo is fine, for other codes it works, please see the first image, that's the render (echo) Im getting

S1SYPHOS commented 1 year ago

I'm sorry, but all provided examples aren't even valid PHP code, no opening / closing brackets, no echo statement (or shorthand thereof), I just can't reproduce your problem!

Please provide a complete code example, which version you are using, etc 🙃

S1SYPHOS commented 1 year ago

Also, just from an image, I can't tell you what went wrong. Please post your example markup (= the code being rendered by PHP)!