Ignoring prompt prefix chars in code blocks from copyable text #4
tkne
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem:
I want to distinguish between sudo user commands (
$
prefix) and root user commands (#
prefix) in code blocks when needed.While that could be easily done with adding the desired prefix in front of the command it is not very user friendly, because once the user uses the copy button the prefix will be included in the clipboard.
Solution:
Here is an example of how I solved it for us.
Custom CSS
Markdown file code block example
This is how it looks like in the end. Copying the
ls -la
commands in either example will not include their prefix in the clipboard while also not impacting on the bash code block (or any other language) for example.Hope I could help!
Beta Was this translation helpful? Give feedback.
All reactions