Allow special characters in preformatted text

For some time I have become use to using preformatted text for example

<pre>``[  267.634250] 8<--- cut here ---
[  267.635983] Unhandled fault: ``[[imprecise external abort]]``
``</pre>

In the tiddlywiki this creates a block with text and the tiddler [[imprecise external abort]] can be accessed whilst special characters like < and > are not processed.

I have recently updated a tiddlywiki and found that the rendering of this now includes a line break before the [[imprecise external abort]] double line space after as if I had typed

<pre>``[  267.634250] 8<--- cut here ---
[  267.635983] Unhandled fault: 
``[[imprecise external abort]]``


``</pre>

Not sure how to correct this unwanted paragraph alignment.

This unwanted feature seems to be in v5.3.8 but was not in v5.3.3 so it appears that this change has been introduced between those versions of Tiddlywiki!

There has been a bug that had to be fixed with long lines of code without spaces. So the CSS has been changed.

You can create a tiddler eg: fix-my-code-style tagged: $:/tags/Stylesheet
With the following content:

pre > code {
    display: contents;
}

It should fix your problem, but will probably re-introduce the other problem.

thanks… that worked for me! Perhaps there is a better way to achieve the style that I would like?

<pre>``this is an example <br> with a link to the tiddler ``[[ToDo]]`` in the preformatted <table> text
which gets more difficult with multiple
lines variable
of variable length
``</pre>

@EricShulman … I did see you typing. Do you have a better solution?

You can try to use the \rules pragma, that allows to exactly specify how a tiddler should be parsed.
eg:

The following rule will disable HTML code like <br> and <table>. It disables all of them, but the rest of the wikitext syntax should still work.

You can play with it and give feedback.

\rules except html

This is an example <br> with a link to the tiddler [[ToDo]] in the preformatted <table> text

The names of the rules can be found at: ControlPanel → Info → Advanced → Parsing

I was only going to provide some general guidance for how to identify the source of the problem by first attempting to reproduce it in previous versions of TiddlyWiki; but, you’ve already identified the cause and provided a workaround, so that isn’t necessary for this specific issue.

-e

thanks… the \rules is an interesting one…

the problem comes with transcluding the tiddler in another tiddler… when you do that all the line feeds you enter disappear and you end up with a blob of text…

also the [[ToDo]] tends to stand out as different to the rest of the text… but its definitely an option!

But perhaps I can use this to my advantage and transclude just the preformatted text from a different tiddler… I will experiment.

@EricShulman I was investigating the cause with firefox web developer tools and comparing the two renderings and found the additional display: block; and was experimenting with that when you answered!

Yea, As far as I can see, I think the CSS route is the right one to go with.

This sounds like it MIGHT be an issue with “inline” vs “block” parsing.
Have you tried using <$transclude $tiddler="..." $mode=block/>?

-e

great suggestion… <$transclude $tiddler="..." $mode=block/> allows me to transclude tables. In inline mode the tables do not get rendered so you get | table | test | rather than a table or # one # two for a list rather than a numbered list.