Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2018-10-11 08:02:49

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Can I escape <p> without Textile?

etc wrote #314533:

Done in 4.7.2 txp Textile, soon on Pete’s demo site, please test.

?

Offline

#38 2018-10-11 08:38:41

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: Can I escape <p> without Textile?

RedFox wrote #314534:

It doesn’t … :o

Shucks! Maybe it needs some extra \s? in there for possible spaces in the markup?

But if txp 4.7.2 will stop adding p tags around tags at the beginning of a line, it will soon no longer be necessary anyway…


TXP Builders – finely-crafted code, design and txp

Offline

#39 2018-10-11 08:54:38

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Can I escape <p> without Textile?

etc wrote #314533:

Done in 4.7.2 txp Textile, soon on Pete’s demo site, please test.

Hurray!
Me just spend some quality time inserting some <txp::short-code /> in the body of some articles; freaky thing (the short-code form) that contains textile formatting.

notextile. <txp::my_shortcode evaluate="textile" />

Thank you Oleg.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#40 2018-10-11 09:54:38

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Can I escape <p> without Textile?

Fine if you find it useful, gentlemen, just note that this change is roughly equivalent to prepending a space, I don’t know whether it has the same effect that notextile. Let me know if that’s not enough.

Edit: seemingly, a space is not notextile: the block is still textiled, just not wrapped in <p></p>. Which mode should we choose for line-starting <tag>?

Last edited by etc (2018-10-11 10:02:37)

Offline

#41 2018-10-11 12:11:20

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Can I escape <p> without Textile?

etc wrote #314539:

Edit: seemingly, a space is not notextile: the block is still textiled, just not wrapped in <p></p>. Which mode should we choose for line-starting <tag>?

The first one, space, I think.

I use notextile. regularly instead of space because it is much more readable. Purpose is most of the time inserting something like short tags (or in the past txp:output_form) and avoid the thing (usually a one liner) being wrapped in a <p />.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#42 2018-10-11 12:39:30

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Can I escape <p> without Textile?

phiw13 wrote #314540:

The first one, space, I think.

Too late :-) The explanation follows.

I use notextile. regularly instead of space because it is much more readable.

They are not equivalent:

notextile. <txp:php>echo "Hello!";</txp:php>

will be rendered as <txp:php>echo "Hello!";</txp:php>, while

 <txp:php>echo "Hello!";</txp:php>

(with a space) produces <txp:php>echo «Hello! »;</txp:php>. I find the latter rather annoying: you generally must precede <txp:php> with notextile, a space wouldn’t suffice.

With the recent change, you don’t need to prepend notextile anymore, just don’t leave empty lines inside your block. If you want it to be textiled without <p>-wrapping, just prepend a space, as before.

Offline

#43 2018-10-12 12:38:31

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Can I escape <p> without Textile?

etc wrote #314541:

With the recent change, you don’t need to prepend notextile anymore, just don’t leave empty lines inside your block. If you want it to be textiled without <p>-wrapping, just prepend a space, as before.

Ok, a bit more restricted than your first patch, but still quite useful. In most of my use cases I won’t need to worry about adding a space.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#44 2018-10-12 15:53:08

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Can I escape <p> without Textile?

phiw13 wrote #314570:

Ok, a bit more restricted than your first patch, but still quite useful.

I find it more useful than before, knowing by experience how easily Textile breaks <txp:php />, be it wrapped in <p /> or not. But if many of us find it restrictive, it’s just few lines to revert.

Offline

Board footer

Powered by FluxBB