Skip to content
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

issue if method eq keyword #21

Closed
yaskevich opened this issue Jun 25, 2011 · 3 comments
Closed

issue if method eq keyword #21

yaskevich opened this issue Jun 25, 2011 · 3 comments

Comments

@yaskevich
Copy link

@yaskevich yaskevich commented Jun 25, 2011

Method that matches language keyword is highlighted as keyword as well (as I see for Perl).
Thus, e.g. there is built-in function (keyword) "sort" and if one prints "object->sort", so in this case "sort" as method of the class will be treated by highlight.js as keyword. Screen shot is here:
http://www.flickr.com/photos/yaskevich/5870302481/

@isagalaev
Copy link
Member

@isagalaev isagalaev commented Jun 27, 2011

Thanks for reporting this. Now what we need is for some Perl guru to figure out how best to fix it… Probably will take some time.

@yaskevich
Copy link
Author

@yaskevich yaskevich commented Jun 27, 2011

I'm not very good with JS, so Highlight.js source code is too sophisticated for me to fix it by myself, but it must be the rule kind of "Perl keyword cannot be prepended with ->".

Also I found another problem: in Perl the construction $#myarray means "index of the last element in the array @myarray", but Highlight.js treat it as a comment (and not only the array, but it marks as a comment everything that follows # here).
For example:

foreach my $num (0..$#array) {
 # comment is here, not above
}

This issue is more important than previous because it's really frequent language construction.

@isagalaev
Copy link
Member

@isagalaev isagalaev commented Sep 22, 2011

Fixed both issues in master branch.

@isagalaev isagalaev closed this Sep 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants