No-Parse option for posts?


(Biscuit) #1

VBulletin has NOPARSE tags that stop it from processing any HTML positioned between the tags, within a post.

This allows people to post messages explaining how to do certain markup commands, without it actually resolving the commands in that post.

Is there any way to do this on Discourse?


#2

Use back-ticks to enclose the code.

Or select the text and click the preformatted text button:

So it looks like this:

<strong>This is bold</strong>


(Biscuit) #3

Thanks @omarfilip. That is exactly what I needed.

Nice and easy to do, once you know how.

Thank you.


(Jay Pfaffman) #4

You can also do blocks with sections of triple backticks.

```
<code goes here>
```

You can also make a single line be code by preceding it with 4 spaces.


(Jeff Atwood) #5

I recommend indenting by 4 spaces, unless you need syntax color highlighting (e.g. you are posting literal computer source code of some kind like Fortran or HTML).

like this

Just type

spacespacespacespacelike this


(Stephen Chung) #6

Is there a difference between four spaces and fenced code blocks I always thought they are equivalent!


(Jeff Atwood) #7

Mostly but the fenced blocks imply source code and colored syntax highlighting.