-
Notifications
You must be signed in to change notification settings - Fork 662
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
console lexer (BashSessionLexer) fails with quotes inside comments #1598
Comments
This is needed because the Pygments lexer (used by Sphinx) has a bug and fails to parse the code blocks that use quotes, it doesn't matter if they arejust in comments. Pygments issue: pygments/pygments#1598
The linked commit (d368202) shows the real situation where I hit this issue. |
Hey @j1elo, the
The If you're presenting pure shell code, you should use one of the shell lexers, usually |
Oh my, that means I was very wrong about the intended use case of The way I see it, this grants then a "documentation" bug in the sense that the docs are really too bare and somewhat confusing. I'll open a couple new issues wrt. to this topic, and close this one in a couple of days (just in case some more insightful comments happen to arrive). |
Folloup from d368202 We learn from pygments/pygments#1598 that the "console" lexer is actually meant for blocks that present a shell prompt, a command, and some result: $ command result However we were using this block type as general purpose command descriptions, which should instead be changed to "shell" type. For symmetry, those blocks which actually contained prompt + command + output are renamed from "console" to the equivalent "shell-session".
Folloup from d368202 We learn from pygments/pygments#1598 that the "console" lexer is actually meant for blocks that present a shell prompt, a command, and some result: $ command result However we were using this block type as general purpose command descriptions, which should instead be changed to "shell" type. For symmetry, those blocks which actually contained prompt + command + output are renamed from "console" to the equivalent "shell-session".
Hi, I'm facing failures from Pygments while trying to build my project's documentation with Sphinx; after some analysis I discovered that the issue comes from single quotes (
'
) being used within comments.A block such as this one causes the issue:
the code-block will try to parse its contents with the
console
lexer from Pygments, which fails:Removing the single quote solves the issue:
Pygments and Sphinx versions:
I searched for "console" and "console quote" and couldn't find an already existing bug so I'm opening this one. Sorry if this is a duplicate (I somehow believe this bug must have been reported already, using a single quote in simple-form English comments seems too much of a common use case to have this bug unnoticed... but I haven't found anything)
The text was updated successfully, but these errors were encountered: