Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Should an article preview parse 'txp:' tags?
I have an article with Textile and txp:
tags in it. When I preview the article from the admin-side, the Textile tags are parsed correctly, but the Textpattern tags are left as inline text, albeit in a different colour.
Is this expected? It looks…odd. Is there a setting I can change to enable txp:
tag parsing in preview mode?
Thank you.
Offline
Re: Should an article preview parse 'txp:' tags?
Does unchecking the Sanitize checkbox change anything?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Should an article preview parse 'txp:' tags?
Bloke wrote #337579:
Does unchecking the Sanitize checkbox change anything?
Where do I find the Sanitize checkbox, please?
Edit: ah, now I see Sanitize on the dev code, not in production – ignore me!
Last edited by gaekwad (2024-08-11 17:31:11)
Offline
Re: Should an article preview parse 'txp:' tags?
Closing – it looks like 4.9.0 will solve this.
Thanks, Bloke!
Offline
Re: Should an article preview parse 'txp:' tags?
On 4.9 you should have two options (checkboxes): one to parse the txp:tags
and one to sanitise tags e.a.
The first one is very useful when editing articles that are already live, before saving anything – which would push the content to full public view.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Should an article preview parse 'txp:' tags?
On a side note: should (unparsed) txp tags be syntax-colourized in Text
mode? I have switched it off since it looks distracting, but there is only one line to change if it has defenders..
In HTML
mode everything should be properly colourized now, including php code inside <txp:php />
.
Offline
Re: Should an article preview parse 'txp:' tags?
etc wrote #338186:
On a side note: should (unparsed) txp tags be syntax-colourized in
Text
mode? I have switched it off since it looks distracting, but there is only one line to change if it has defenders..In
HTML
mode everything should be properly colourized now, including php code inside<txp:php />
.
Yes!
But this has some bugs ATM
1. an inline link based on a shortcode, input markup
some text: <txp::pdf id="67" />.
generated HTML output in Preview text view
some text: <code class="language-markup txp-tag"><txp::pdf id="67" /></code>
2. similar, a <txp:tag />
block such as
<txp:image escape="" id="1" wraptag="p" width="100" height="100" />
generated HTML output in Preview, text view
<code class="language-markup txp-tag"><txp:image escape="" id="1" wraptag="p" width="100" height="100" /></code>
The offending css selector:
code {
&.txp-tag {
color: var(--txp-prism-token-8, hsl(270, 50%, 40%));
}
}
All are coloured purple or red depending on the admin theme in use.
Last edited by phiw13 (2024-11-12 00:00:13)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Should an article preview parse 'txp:' tags?
phiw13 wrote #338191:
But this has some bugs ATM
…
All are coloured purple or red depending on the admin theme in use.
What’s wrong with it? This colour just makes txp tags stand out from the ‘normal’ text (or code), there is no syntax highlighting involved. Otherwise, there would be no visual difference in preview between a textiled code snippet
@<txp::pdf id="67" />@
producing
<code><txp::pdf id="67" /></code>
and a ‘real’ <txp::pdf id="67" />
tag. Themes can override .txp-tag
rules if necessary.
Offline
Re: Should an article preview parse 'txp:' tags?
etc wrote #338196:
What’s wrong with it? This colour just makes txp tags stand out from the ‘normal’ text (or code), there is no syntax highlighting involved. Otherwise, there would be no visual difference in preview between a textiled code snippet
<txp::pdf id=“67” />@…@
producing
<code><txp::pdf id="67" /></code>...
and a ‘real’
<txp::pdf id="67" />
tag. Themes can override.txp-tag
rules if necessary.
Ok. Then, It is not a bug. I don’t really see the point of eliminating the distracting code colouring then.
(And of course I have already overwritten that).
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Should an article preview parse 'txp:' tags?
Oleg,thanks for changing that to use some opacity. That is better.
But one thought, how about using the secondary / demoted custom prop. that I am suggesting here: forum.textpattern.com/viewtopic.php?pid=338204#p338204 ? That has several benefits, an admin theme can more easily redefine it for users needing some more contrast (prefers-contrast: more
), for users preferring no transparency, for Windows users setting their OS to forced-colors mode, etc.
There are two instances: the code.txp-tag
selector discussed here, and the txp-sanitized
class.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Should an article preview parse 'txp:' tags?
phiw13 wrote #338205:
how about using the secondary / demoted custom prop. that I am suggesting here: forum.textpattern.com/viewtopic.php?pid=338204#p338204 ?
Certainly a good idea, will implement it in the next round of css tweaks, thank you.
Offline
Re: Should an article preview parse 'txp:' tags?
I have added a Tester Egg, to fold/unfold sanitized elements and txp tags in text preview mode. Currently it works by ctrl+click
on Sanitize
button, replacing these elements with abbreviated versions. For example,
<txp:php a="Hello!">
echo $a;
</txp:php>
becomes <txp:php…/>
and can further be totally hidden via a css rule.
Having many large txp blocks in my articles (bad practice!), I find it useful, but it can certainly be improved UX-wise. Testers welcome.
Offline