How to avoid Typo3 automatically rendering addresses as links?

51 views Asked by At

I have entered the following "formatted" text in the "page" view in Typo3:

$ curl -s https://www.hello.ch/repo.gpg

Which has the following "source" in the same view:

<pre>$ curl -s https://www.hello.ch/repo.gpg</pre>

This source is exactly what I would expect in the rendering, but instead it gets rendered into:

<pre>$ curl -s <a href="https://www.hello.ch/repo.gpg" target="_blank">www.hello.ch/repo.gpg</a></pre>

I would just like to have the non linked version rendered:

<pre>$ curl -s https://www.hello.ch/repo.gpg</pre>

So that it does not display a link in the final HTML. How do I achieve this?

The only way I manage to avoid the automatic rendering is by adding some extra character right before "https", for instance:

<pre>$ curl -s _https://www.hello.ch/repo.gpg</pre>

But the underscore of course makes the instructions wrong.

2

There are 2 answers

0
Daniele On BEST ANSWER

While I did not manage to implement what was suggested in the answer by Jo, I found a way to display the address correctly (i.e. including the https:// prefix) by explicitly linking the text to the address itself within the page view text box. Basically I did the following:

  • In the page view textbox, I selected the address part of my text (https://www.hello.ch/repo.gpg) of the following line:

$ curl -s https://www.hello.ch/repo.gpg

  • I clicked on the link icon of the text box to create a link with the selected text

  • I chose "External URL" and pasted the full link text in the URL field and clicked "Set Link"

  • I saved and reloaded the rendered page and I got the following html source:

<pre>$ curl -s <a href="https://www.hello.ch/repo.gpg" target="_blank">https://www.hello.ch/repo.gpg</a></pre>

Although this is a bit different from what I originally wanted:

<pre>$ curl -s https://www.hello.ch/repo.gpg</pre>

It still serves my purpose correctly, because the line is displayed including the https:// prefix and when one copies the line from the page, he will paste the correct text in bash:

$ curl -s https://www.hello.ch/repo.gpg

0
Jo Hasenau On

You can adjust the behaviour of lib.parseFunc and lib.parseFunc_RTE to get what you want. Especially externalBlocks might be the one to help you in this case:

https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Functions/Parsefunc.html#externalblocks