EnlighterJS / EnlighterJS

:high_brightness: an open source syntax highlighter written in pure javascript
https://enlighterjs.org/
Mozilla Public License 2.0
1.03k stars 214 forks source link

Wrong method highlight in php if it is named «do». #181

Closed oleg-dk closed 2 years ago

oleg-dk commented 2 years ago

Wrong method highlight in php if it is named «do». E.g. in code

public static function customAgent()
{
    if (self::setDocumentRoot() === false) {
        self::log('fail to set document root', ['type' => 'error']);
        return '\\'.__METHOD__.'("errUnknownDocRoot");';
    }

    $result = self::do('customAgent');
    $result = self::parseResult($result);
    self::emulatePeriodical();
    return '\\'.__METHOD__.'('.($result ? $result : '').');';
}

screenshot: https://i.imgur.com/fDdQvpq.png

It seems that it highlight as reserved word, but not a method.

EnlighterJS Syntax Highlighter 3.5.1

AndiDittrich commented 2 years ago

image

thanks for your report, has been fixed