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

Reuse found lexer in SyntaxHighlightFilter #324

Merged
merged 1 commit into from
Dec 19, 2019

Conversation

JuanitoFatas
Copy link
Contributor

@JuanitoFatas JuanitoFatas commented Dec 19, 2019

This Pull Request:

  • Pass down the found lexer so we do not need to find that lexer again in Rouge.highlight
    - Remove text = node.inner_text local variable assignment since no one use it later on.

@gjtorikian
Copy link
Owner

Nice, thank you!

I think text = node.inner_text should remain, though, just because it makes sense to have it remain a little more explicit. What do you think?

so we do not need to find it again down the road.
@JuanitoFatas JuanitoFatas changed the title Reuse found lexer and unused local variable Reuse found lexer in SyntaxHighlightFilter Dec 19, 2019
@JuanitoFatas
Copy link
Contributor Author

Thanks for the review. I agree with you that explicit is good, updated in 79d12b9.

@gjtorikian
Copy link
Owner

Thanks!

@gjtorikian gjtorikian merged commit e4c9782 into master Dec 19, 2019
@gjtorikian gjtorikian deleted the syntax-highlight-filter/patch-1 branch December 19, 2019 17:55
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.

2 participants