-
Notifications
You must be signed in to change notification settings - Fork 750
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
Add HTML::Mason lexer #838
Conversation
Thanks for the contribution, but this lexer can't handle the following snippet:
Rouge can handle nested syntax, although there are a few docs. https://github.com/jneen/rouge/blob/master/lib/rouge/lexers/erb.rb might help you. |
9194bbf
to
9ebd6d6
Compare
Thanks for the feedback! I've updated the sample and the lexer. |
@miparnisari I am not familiar with this framework so forgive me if this doesn't make any sense. Would it be helpful to subclass the HTML lexer so you don't have to rewrite the HTML-specific pieces? Then simply add on the framework highlighting on top? |
e8685ff
to
bbcdd44
Compare
I changed this lexer to inherit from .dashed {
background: url("<% $someUrl %>");
} But I can live with that. I'm not going to change the CSS lexer for this. |
488c331
to
be42b23
Compare
be42b23
to
5ef59cf
Compare
@dblessing any chance of merging this soon? |
12ddf8e
to
482693c
Compare
@miparnisari All of your outstanding pull-requests are on my list of stuff to go through, so sure.. I just went for the easy/low hanging fruit first (which mostly meant the ones with little previous discussion). |
@miparnisari It might be worth creating a new branch from the current master, adding your changes to that and then pushing a new PR. This one's now got a whole lot of irrelevant files that'll make things more difficult to review in the future. |
@pyrmont i screwed up while updating my fork haha. But it should be good now, there's only 6 files changed |
9e79279
to
cf8b8ee
Compare
Will try to have a look at this one soon, @miparnisari! |
@pyrmont any news? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot this one was outstanding (which is supposed to be the point of the needs-review
tag, I realise!).
In addition to the comments here, we've now moved to use rule %r/.../
rather than rule /../
to keep RuboCop happy. Could you update these as well? Rules in the form of rule %r(...)
are fine and don't need to be updated.
@pyrmont I tried to update rules like |
@miparnisari Have you tried keeping the parentheses: - rule(/(.*?)(?=%>)/m) { delegate @perl }
+ rule(%r/(.*?)(?=%>)/m) { delegate @perl } Either ways, the primary reason for adopting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! I marked the previous review as approved and then of course noticed something I wanted to comment on.
@miparnisari Yep, @ashmaroli is correct. You don't need to worry about adding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes recommended..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more change, sorry!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one last change!
Hey, look! It's finally merged! :D |
Thanks so much @pyrmont !!! Best way to start my Friday :D |
HTML::Mason is a templating framework, much like ASP.NET Razor. Basically the syntax is this: everything is considered to be HTML code unless a special block, a comment, a substitution tag, a component call, or a line that begins with
%
is encountered.See below how the result of this PR compares against IntelliJ's Perl5 plugin.