You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My issue is about the documentation content or website
Type of issue
Other
Description
The code blocks for docker shell commands typically show a prompt of "/ # ", but this prompt is not recognized by the shell lexer associated with the console language. As a result, when the code is copied using the copy icon, the prompt is included in the copied text, causing errors when pasted.
If I'm following things correctly, the console/shell lexer that this github page is using is read-only and there aren't any other lexers with more comprehensive notion of shell prompts. As such, I'd suggest removing the prompt from the code block until such time as a suitable lexer is available.
The text was updated successfully, but these errors were encountered:
We're using the lexer from chroma to generate these code blocks. Not that it matters - chroma also does not recognize the shell prompt format in these examples. Even if it did, the shell prompt is actually manually excluded from the copied text with a regex:
We could add something like [/\w]+\s[#$] to the above regex to exclude it from the copied contents. But it's already hacky as it is... maybe there is a more elegant solution. E.g. a custom component we could use to render console I/O examples...
dvdksn
changed the title
getting-started code blocks include prompts not supported by language qualifier
code blocks include prompt chars when copied
Nov 4, 2024
Is this a docs issue?
Type of issue
Other
Description
The code blocks for docker shell commands typically show a prompt of "/ # ", but this prompt is not recognized by the shell lexer associated with the
console
language. As a result, when the code is copied using the copy icon, the prompt is included in the copied text, causing errors when pasted.Location
https://docs.docker.com/get-started/workshop/05_persisting_data/
Suggestion
If I'm following things correctly, the console/shell lexer that this github page is using is read-only and there aren't any other lexers with more comprehensive notion of shell prompts. As such, I'd suggest removing the prompt from the code block until such time as a suitable lexer is available.
The text was updated successfully, but these errors were encountered: