New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua block comment totally broken #32

Closed
hartman opened this Issue Nov 13, 2014 · 7 comments

Comments

Projects
None yet
5 participants
@hartman
Contributor

hartman commented Nov 13, 2014

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

This comment has been minimized.

Contributor

hartman commented Nov 13, 2014

@anomiex

This comment has been minimized.

anomiex commented Nov 13, 2014

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

@anomiex

This comment has been minimized.

anomiex commented Nov 13, 2014

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

This comment has been minimized.

Contributor

hartman commented Nov 13, 2014

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

@Streusel

This comment has been minimized.

Contributor

Streusel commented Dec 4, 2014

@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

This comment has been minimized.

Contributor

hartman commented Dec 5, 2014

@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.

hartman added a commit to hartman/geshi-1.0 that referenced this issue Feb 2, 2016

Fix Lua comment blocks and string blocks.
- Match comments non-greedily instead of greedily
- Re-add support for block strings (similar to heredoc)

Wikipedia issue: https://bugzilla.wikimedia.org/show_bug.cgi?id=73281
Wikipedia review: https://gerrit.wikimedia.org/r/173104

This fixues issue GeSHi#32
@splitbrain

This comment has been minimized.

Contributor

splitbrain commented Mar 16, 2017

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

@cweiske cweiske closed this Mar 31, 2017

@cweiske cweiske removed the patch-needed label Mar 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment