Dtext: Preformatted Text in Wiki

Posted under General

Is there a way of literally showing preformatted text or code in the Wiki?

I am referring to something like the tag on most bbcode forums, where one can cause the system to ignore markup code and show text in a fixed width font. Currently writing Wiki documentation on using Dtext, and need to show examples of using code. Could use the old trick of adding spaces to the formatting tags, but telling someone to "remove the spaces from the tags" looks kind of clumsy.

Updated by kounishin

This is a horrible workaround, but you can insert zero width spaces to keep the markup from parsing. Just copy the character between these quotes "​" and paste it inside the markup tags. Like this:

[​quote]
h​4. A header

*​ List item 1
*​ List item 2
*​ List item 3

h​ttp://www.google.com

[​[touhou|Touhou]]

{​{touhou}}

p​ost #362759

"​derp"​:h​ttp://zombo.com
[​/quote]

That's actually even worse than the current workaround because if I copy/paste that code into a new page I can't even tell what I need to remove and wouldn't know there was anything to remove even after I preview/posted it.

It should be simple to add a code tag but as always there are issues with how it interacts with other tags. I'm sure pre can't be contained in a p tag so it'd probably have to be handled as an exception.

Please create a Trac ticket if you're interested.

<pre> can't - it's block-level, as you know - but <tt> and (both of which usually render the same way) can. Mind you, I'm not sure that having it in the middle of paragraphs is actually the best choice (especially for wiki use, where you want things to be clear), but the need is probably rare enough either way that I'd support whichever is easier to implement.

1