Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,526
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 />.

Offline

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

etc
Developer
Registered: 2010-11-11
Posts: 2,833
Website

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.


etc_[ query | search | pagination | date | tree | cache ]

Offline

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

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,526
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.

Offline

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

etc
Developer
Registered: 2010-11-11
Posts: 2,833
Website

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.


etc_[ query | search | pagination | date | tree | cache ]

Offline

Board footer

Powered by FluxBB