Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Note: This is a general question about Markdown formatting for any Markdown renderer (e.g., Gitlab, Github, Codidact). So this is not just a question about Codidact's renderer. When displaying she...
#2: Post edited
how to ignore/exclude a character in markdown syntax highlighting
- how do I get markdown to render # as a shell prompt and not a comment?
#1: Initial revision
how to ignore/exclude a character in markdown syntax highlighting
*Note:* This is a general question about Markdown formatting for any Markdown renderer (e.g., Gitlab, Github, Codidact). So this is not just a question about Codidact's renderer. When displaying shell commands in Markdown, I often want to use the hash sign (`#`) to indicate that I am running the command as root. However, Markdown renderers usually interpret the `#` character as the beginning of a comment, which results in the entire line being rendered as a comment (usually in the color gray). For example, using the shell code fence (\`\`\`sh), the following command is rendered as intended with colors: ```sh echo hi ``` However, if I precede that command with `#`, the Markdown interpreter thinks the entire line is a comment: ```sh # echo hi ``` Is there anyway to tell Markdown to ignore/exclude the `#` character?