Solved Showing literal backticks in posts here
-
I sometimes find myself wanting to tell posters to put their code inside the triple-backticks at start & end. Does anyone know of a way I can produce literal, monospace (code), triple-backticks to show them visibly in a post in this forum?
The following shows it using single-quote characters:
'''
I can produce that with backticks by putting a space between each one:
` ` `
Can anyone figure a way to type to make that appear without the spaces? :) Plus a bonus point if you can make the triple-backticks appear in-line instead of in a block of their own!
-
Testing...
```
-
OK, it worked but outside of any code block :/ You need to prefix each backtick with a backslash.
Now in a code block:
\```
I've just put a single backslash in front of all 3 backticks, but it is being printed, that is bad.
```
Aha!
So, summary for everybody: use 3x tilde
~
to wrap around 3 visible backticks. -
Hi
Ahhh.
```
-
@sierdzio , @mrjj
Sorry, I''m not following what you guys are doing, can you be more explicit? And tildes don't seem to work for me.
I would like the triple-backtick to come out as code/literal/monspace I can't even tell whether yours are?And, what about the triple-backtick in-line:
'''
<- like this but with backticks?Please try to explain for an idiot like em exactly what you want me to type?
Triple-tilde, then triple-backtick, then triple-tilde:
```
Oh! Are triple-tildes like triple-ticks for code blocks then?
What about these backticks but in-line?
-
Nope, tilde does not work inline :-(
```
Oh! This works! So it is:backtick space 3xbacktick space backtick
-
@sierdzio
Hello```
world!Oh, OK! I promised a "bonus point" for that, but I think the need to put the spaces in deducts from that? :)
Going back to tildes/block, you didn't answer:
Oh! Are triple-tildes like triple-ticks for code blocks then?
-
@JonB said in Showing literal backticks in posts here:
@sierdzio
Hello```
world!Oh, OK! I promised a "bonus point" for that, but I think the need to put the spaces in deducts from that? :)
Going back to tildes/block, you didn't answer:
Oh! Are triple-tildes like triple-ticks for code blocks then?
Seems so.
int nothing = 0; function();
int nothing = 0; function();
First block is created with tildes, second with backticks.
-
@sierdzio
And where is this documented...? :)Thanks, great answers, I'll try to remember the two ways for block- or in-line.
-
@JonB said in Showing literal backticks in posts here:
@sierdzio
And where is this documented...? :)Dunno, it was just a guess :-)
It seems to be part of Markdown: https://sourceforge.net/p/tilde/wiki/markdown_syntax/#md_ex_code but most guides for MD do not mention it. Some claim it's for preformatted text and not for code.
Thanks, great answers, I'll try to remember the two ways for block- or in-line.
There seems to be another way (since NodeBB supports Markdown syntax): Use TWO backticks if you want to use backticks inside of a block.
like `this`, see?
It's described in https://www.markdownguide.org/basic-syntax/#code