How to write three ticks (`) in post content?

I want to educate some users on using code fences for posting code.
How can I post three ticks (```) as text without the “after one tick mark text as preformatted”?

Like this?

```

Four spaces, then three ticks. Check out http://commonmark.org/help/ for a reference as well!

1 Like

Actually directly inside a line of text, so I can post something like

I edited your code to display better. Please use (three ticks) in the line in front and after your code to enable this formatting yourself. Thanks.)

But with the three ticks instead of “(three ticks)” of course.

(Man is it hard to describe this if every try to actually type it gets removed ;))

It’s very, very tricky to get that right inline. Another way is backslash

```

\`\`\`
2 Likes

Testing: ```

That works, thanks.

1 Like

Good luck with that :wink:

To make it even more complicated:
Is there a way to preformat the three ticks now in line? So we have this nice grey background to make the command stand out…

Try this ```
Using so:
<code>\```
Edit: forgot to close tag :sweat_smile:

2 Likes

Fancy².

Let’s see if this works to output the three ``` (```) needed to format code. Yes it does. Didn’t know about <code> before. Thanks!

PS: Uh, did I just discover a “bug” in the quote engine? Backslashes are gone…

Back slash where?
Inside your bracket?

I quoted your <code>\``` in my response. There it shows without the backslashes.
Super edge case of course, but [quote] seems to miss the \ on output.

Oh… that might be a separate bug but we can ask @codinghorror
Maybe raise a new bug topic.
But it seems your use case is covered for now :smile:
Cheers

Done: [quote] loses backslashes on this super edge case

And yes, I’m happy with my solution. Thanks!

1 Like

just an FYI :smile:

you can click the chain icons > new topic to create a topic out of a post.

2 Likes

What kind of sorcercy…

Awesome. Thanks.

2 Likes

This topic was automatically closed after 2607 days. New replies are no longer allowed.