hugo
hugo copied to clipboard
Use short token for code highlighting
Closes: #5349
As noted in #5349, rst2html can generate HTML with short or long form class names for syntax highlighting. Pygments (via the pygmentize command) seems to generate short form by default without any way to switch this. This means most/any stylesheets for code provided with various themes won't work when using rST output. This can easily be fixed by providing the --syntax-highlight=short flag to rst2html.
I don't know enough about RsT to merge this. I'm mostly concerned if this new flag will somehow break in some RsT versions.
@anthonyfok any input? others?
I don't know enough about RsT to merge this. I'm mostly concerned if this new flag will somehow break in some RsT versions.
The flag has been present in docutils since at least 0.9.1, which was released in 2012. Ubuntu 16.04 uses 0.12. I think this is pretty safe now.
Looks like there's now a merge conflict because the location of this code changed. If I were to rebase this PR, would that be somethign that could merged, or are there larger concerns?
I've rebased this. It's definitely safe
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
This is still valid. Let me know if I can help explain anything
@stephenfin looks like there's a merge conflict to resolve here.
As I said, I don't know enough about this to review this.
I have tested this, and I'm using it in my fork of hugo.
I also created #7763 which solves this issue as well as an issue with math formatting in reStructuredText, if you want to merge that one instead. One benefit of #7763 is that there are tests so you can see the expected output more clearly.