Skip to content

Add *.cshtml file glob to HTML lexer#1522

Merged
pyrmont merged 1 commit intorouge-ruby:masterfrom
pyrmont:feature.cshtml-support
Jun 3, 2020
Merged

Add *.cshtml file glob to HTML lexer#1522
pyrmont merged 1 commit intorouge-ruby:masterfrom
pyrmont:feature.cshtml-support

Conversation

@pyrmont
Copy link
Copy Markdown
Contributor

@pyrmont pyrmont commented May 30, 2020

'Razor syntax' is a feature of ASP.NET web programming. By convention, files that use this syntax, use the .cshtml extension. While Rouge does not properly support Razor syntax, discussion in #873 indicates that the HTML lexer would be preferable to these files being lexed as plaintext.

This PR adds the file glob and a test. It fixes #873.

@pyrmont pyrmont added the needs-review The PR needs to be reviewed label May 30, 2020
@pyrmont
Copy link
Copy Markdown
Contributor Author

pyrmont commented May 30, 2020

@Cerbrus Does this look OK?

@pyrmont pyrmont self-assigned this May 30, 2020
@Cerbrus
Copy link
Copy Markdown

Cerbrus commented Jun 2, 2020

@Cerbrus Does this look OK?

Hi, thanks for taking a look at this. I'm not sure how I can check, though?

@pyrmont
Copy link
Copy Markdown
Contributor Author

pyrmont commented Jun 3, 2020

@Cerbrus It is a little difficult. You could check out the code in the PR, update the HTML visual sample with some CSHTML and see how it looks but given that it's basically HTML with @-expressions scattered around, I don't think that's really necessary. I'll merge in.

@pyrmont pyrmont merged commit a5b35cf into rouge-ruby:master Jun 3, 2020
@pyrmont pyrmont deleted the feature.cshtml-support branch June 3, 2020 20:02
@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Jun 3, 2020
@pyrmont
Copy link
Copy Markdown
Contributor Author

pyrmont commented Jun 3, 2020

@Cerbrus OK—got it in. This will be part of the next version of Rouge: v3.20.0. That will be pushed out to RubyGems on Tuesday 9 June. Sorry for the wait!

mattt pushed a commit to NSHipster/rouge that referenced this pull request May 19, 2021
�����This commit adds the `*.cshtml` file glob to the HTML lexer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cshtml

2 participants