How can I enter really plain code (tw should display simply entered text!)

Hi,
sometimes I try to enter some “code” in my TW, but TW will display the text in a unexpecxted way.
I.e., linefeeds will dissappear.

Actual I “simply” want to add this “code”:

''TOPIC 1''

Line 1
DisplayText [zf1s1l1c1]Zeile 1 aaaaaa[f1s1l2c1]<Textbbbbb>

Line 2 

But in the moment I add the [ after the “bbbb”, the linefeed will removed and the Line 2 is shown direct after Textbbbbb:

''TOPIC 1''

Line 1
DisplayText [zf1s1l1c1]Zeile 1 aaaaaa[f1s1l2c1]<Textbbbbb>[

Line 2 

------------------------------>>

Results in (give this a output):
TOPIC 1

Line 1 DisplayText [zf1s1l1c1]Zeile 1 aaaaaa[f1s1l2c1][ Line 2

So issues like this are not “easy” to unterstand :frowning:

I also try the options from the menu like “wrap”, or quoted, monospace…

You might be facing two distinct problems here:

  • Linebreaks
  • Code display

In WikiText, linebreaks must be doubled in order to appear in the output. If you want to use single linebreaks, read this.

If you want to display “code” without any transformation, you can use some WikiText syntax depending on the context:

  • Code included in a line of text [[like this]] must be enclosed between backticks
  • Code blocks must be enclosed between triple backticks lines (lines of text only containing 3 backtick characters)

The mandatory doc reference.

Edit: the behavior change when you add an opening square bracket [ is probably caused by the fact that square brackets are used in many WikiText syntax like [[links]], images [img[blah]], etc.

Fred

As @tw-FRed said, it’s because of the wikitext parser.

To add on the answer given, you can also disable the wikitext parser with a pragma rule (a line of code at the start of the tiddler) or with a typed block. You can also use a typed block to set a pragma rule anywhere in the tiddler, which will be restricted to the typed block.

For more info see the tiddlers on WikiText Parser Modes.

Another option is to render the text with a widget :

Thank you;
in my understanding the double brakes will “create link”, so also in my case (also if I don’t use the text “DisplayText” (and I already turned of the “camel case wiki links”

Actual I use the `` chars to enter this specific “code”, seems displayed corectly in a colored text box.