GeSHi / geshi-1.0

Original version of Generic Syntax Highlighter for PHP
http://qbnz.com/highlighter/
GNU General Public License v2.0
168 stars 101 forks source link

Lua block comment totally broken #32

Closed hartman closed 7 years ago

hartman commented 10 years ago

We updated MediaWiki to the latest version of Geshi last week, but now all Multiline comment blocks in the Lua language no longer close.

Examples:

hartman commented 10 years ago

Suspects are: https://github.com/GeSHi/geshi-1.0/commit/d55d075e97eba7ce1dd22dd709fa6dbdabd941e7#diff-c1c00cfdab2a2a0fafc18e0edd552d99 https://github.com/GeSHi/geshi-1.0/commit/f53238468369afc652c0381bc53be81a32be78c2#diff-c1c00cfdab2a2a0fafc18e0edd552d99

@reedy i think we need to ping Marius :)

anomiex commented 10 years ago

More specifically, long-form comments are being matched greedily rather than non-greedily. The patch shown in f53238468369afc652c0381bc53be81a32be78c2 seems to be the culprit in changing a .*? to .*.

anomiex commented 10 years ago

That same commit seems to have broken the highlighting of multi-line strings, which appears to have been abusing COMMENT_REGEXP in the absence of STRING_REGEXP.

hartman commented 10 years ago

I have a tested fix, will open pull request in a bit.

Streusel commented 9 years ago

@hartman Alignment issue and nothing points to the first index, only 2 and 3, intended?

edit: nvm, you fixed the alignment in a followup commit, but the first index isn't used.

hartman commented 9 years ago

@Streusel well, I mirrored how this was done for PHP. So 'COMMENT_SINGLE' => array(1 => "--") would be index 1.

I admit i didn't check if that is actually the correct or proper way to do it, but it seems to work for the php file.

splitbrain commented 7 years ago

This should be fixed with the merge of #63 and can be closed I believe.