Community

'Preformatted text' tag hides single ticks, maybe other characters

Hi, I noticed that the code (preformatted text) tags aren’t working as they used too, it seems to be not displaying (but also not stripping) single ticks, if nothing else.

I happened to copy paste a bit of code and then pasted it, and the ticks appeared! Can’t see them in the post but there are there.

Wonder what is going on

Hello,

This forum now uses Markdown. Surround all code with triple ticks like the following:

For me its still necessary to add brackets around the content within the triple ticks.

But now with testing I find that an additional bracket inside the first would break everything. I guess that may not be an issue

And the brackets show up in the code as well, quite interesting

Brackets are not required, and there’s no problem I’ve observed so far. If you can provide a screenshot of the oddity, I’ll tell you what went wrong, but you you don’t need [ ] before the triple backticks, as shown in my picture above.

triple ticks inside triple ticks are hidden

Triple ticks are not very common in the MODX world though, are they?

Yeah hopefully its not worse than that. Now my brackets are not even able to get the ticks to show, I had to give up on showing the ticks at all.

I would expect its worse than just ticks, I mean I lucked into finding this out. If we can’t see all the code, and have to copy paste every time, that’s pretty tough. Let’s hope its only some unusual characters

You’ve not actually shown me an example of it not working, so I’m not sure what you’re experiencing here… There’s no usage of triple ticks in MODX anywhere, as far as I know, and as long as you enclose all code in triple ticks then single ticks (and double ticks) show up just fine:

[some test `test` yay ``test`` this is a lot of testing `test`]

`test`[test`test`]

A point of clarification, triple ticks inline do not work. You can set off a single word or phrase inline using single ticks.

For code blocks you need a new line before your triple ticks and then a new line before your code.
<?php here is some php with a single tick ` and some [[~other stuff]] and a double tick``
Now is some text.

In order to keep it clean and readable, I generally insert a newline and a blank line before a code block as follows:

<h1>This is a Title</h1>

<p>This is a paragraph.</p>

I hope this helps

1 Like

I have, I attached the screenshot, please don’t say I didn’t. Look at the text on the screen. Look at the text in the editing box. They are the same.

Yes its fine i just wonder, I guess it is an extreme example. Ah I see Jay’s answer, this is the problem, I saw the new line in Elizabeth’s code but did not check it myself.

Yes, I confirmed, it does work, all the ticks show now.

Actually, upon testing further, all you need is a space between your triple ticks and any other ticks you wish to use. Although, you won’t get nice indented preformatted blocks when you do it inline.

This is a sentence with a ``double or ` single tick and then you put a space between any other ticks you want to show and the triple tick.

I found that I could put 6 ticks in a row (with text in between) on each side with no linebreak, and it was ok. With linebreaks, lol it doesn’t work because it makes two empty code areas.

I guess now I understand the three ticks, I mean who the heck uses three ticks

The point of parser languages is to use sufficiently obscure character combinations or symbols that are unlikely to be found in normal typing. So, for code blocks, the triple tick became the flag. Similarly, for exporting resources from MODX to CSV, I often have to use something other than the " because it is so often found in wrapping attribute values in HTML. Instead, I use things like the to wrap text. It’s not meant to be intuitive but functional.

1 Like

I think the Modx to CSV part of this comment should be reposted in the guides somewhere, its quite useful for anyone in that situation

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.