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

csharp wrong highlighting using attributes with string params #1093

Closed
dacanizares opened this issue Feb 25, 2019 · 2 comments · Fixed by #1117
Closed

csharp wrong highlighting using attributes with string params #1093

dacanizares opened this issue Feb 25, 2019 · 2 comments · Fixed by #1117

Comments

@dacanizares
Copy link

As you can see the string sent in the Router attribute is wrongly encoded: http://rouge.jneen.net/pastes/xlA9

Example of code to reproduce the issue:

[Route("api/[controller]")]
[ApiController()]
public class UsersController : ControllerBase
{
    protected readonly IUsersRepository _repository;
    
}

You can see a similar code on the official docs: https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-2.2&tabs=visual-studio#add-a-controller

@dacanizares
Copy link
Author

As you can see here, string arguments are not being highlighted when used inside an attribute: http://rouge.jneen.net/pastes/pD9W

@dacanizares dacanizares changed the title csharp wrong highlighting for Route attributes csharp wrong highlighting using attributes with string params Feb 26, 2019
pyrmont added a commit to pyrmont/rouge that referenced this issue May 19, 2019
The C# lexer generated `Name::Attribute` tokens for attributes. As
discussed in rouge-ruby#1093, this caused attributes to be rendered incorrectly.
This commit removes the rule that caused attributes to be rendered this
way. It fixes rouge-ruby#1093.
@pyrmont
Copy link
Contributor

pyrmont commented May 19, 2019

This was being caused by this rule. I've submitted a fix that removes it.

pyrmont added a commit that referenced this issue May 27, 2019
The C# lexer generated `Name::Attribute` tokens for attributes. As
discussed in #1093, this caused attributes to be rendered incorrectly.
This commit removes the rule. It fixes #1093.
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 a pull request may close this issue.

2 participants