Skip to content

Theme Rendering Inconsistency on PHP codes #103

@blackjyn

Description

@blackjyn

Hello, I'm migrating from hihglight.js to hihglight.php.
I was able to setup basic things to make it work. However I have issue with the rendering.

In my case I want to highlight some PHP codes with Paraiso Dark theme. BUT the result is bit different. Consider:

highlightjsphp rendering inconsistencies

So ones that was done with highlight.js is perfectly rendered, the enum keyword is recognized and so does the self:$key construct inside the match body.
While ones that was done with hihglight.php is not as perfect as that.

I have tried to use both manual mode and auto detect mode but no luck :

$hl=new Highlighter();

//didn't work 
$hl->setAutodetectLanguages(["php"]);
$highlight=$hl->highlightAuto($codes);

//didn't work either
$highlight=$hl->highlight("php",$codes);

This is my env:

  • PHP 8.2
  • highlight.php v9.18.1.10

help?

UPDATE
This is also affect other sources too, I've tried to highlight JS code and the rendering is different from it should be

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