Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-08-26 14:32:36

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 253
Website

Re: Textile does not output

colak wrote #319144:

It has to do with how textilie works. Unless another textile tag is added such as the h2 tag, sentences are always wrapped with the p tag. If you do not want the p tag, you should start with a single space preceded by an empty line. textile-lang.com/ is an excellent reference where you can also test your usage of textile using editable textfields, to make sure that your textile is behaving as intended.

It didn’t behave like this until I updated to the latest version of txp…

The issue now is that when I use raw html, sentences are not wrapped with the p tag unless I use the extra lines above and below.


JapaneseStreets.com – Japanese street fashion (mostly txp)
Old Photos of Japan – Japan between 1860 and 1940 (100% txp)
MeijiShowa – Stock photos of Japan between 1860 and 1940 (100% txp)

Offline

#12 2019-08-26 14:56:39

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,487
Website

Re: Textile does not output

There has, I believe, been a more recent change where it’s no longer necessary to put a space at the beginning of the line to disable textile if a line begins with a tag bracket. That use case should now work without the extra space. I think this was to make it easier to use txp::shortcodes in the body field.

Otherwise the preceding space acts like notextile.{space}.

However, you always did need a blank line to prompt a new <p> tag between paragraphs; a regular line-break produces just a br tag.


TXP Builders – finely-crafted code, design and txp

Offline

#13 2019-08-27 01:13:16

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 253
Website

Re: Textile does not output

jakob wrote #319146:

There has, I believe, been a more recent change where it’s no longer necessary to put a space at the beginning of the line to disable textile if a line begins with a tag bracket. That use case should now work without the extra space. I think this was to make it easier to use txp::shortcodes in the body field.

Otherwise the preceding space acts like notextile.{space}.

However, you always did need a blank line to prompt a new <p> tag between paragraphs; a regular line-break produces just a br tag.

Thanks, Jakob.

But is it expected behavior that no html is added at all (to the full text) when I add raw html without the space?

This is the behavior that I am experiencing.

When I input this in Body:

Tokkotai (suicide squad or _kamikaze_) pilot during WWII, photographed in Tottori in July 1945.
<br /><br />
IMPORTANT
Maximum file size: 18.1M (3008 x 1970 pixels @ 300dpi)

it outputs this (no html and Textile is ignored):

Tokkotai (suicide squad or _kamikaze_) pilot during WWII, photographed in Tottori in July 1945.
<br />
<br />

IMPORTANT
Maximum file size: 18.1M (3008 x 1970 pixels @ 300dpi)

But when I input this in Body (notice the space in front of <br /><br />):

Tokkotai (suicide squad or _kamikaze_) pilot during WWII, photographed in Tottori in July 1945.
 <br /><br />
IMPORTANT
Maximum file size: 18.1M (3008 x 1970 pixels @ 300dpi)

it outputs this (html for all text, and Textile is applied):

<p>Tokkotai (suicide squad or <em>kamikaze</em>) pilot during <span class="caps">WWII</span>, photographed in Tottori in July 1945.
 <br />
<br />
<span class="caps">IMPORTANT</span><br />
Maximum file size: 18.1M (3008 &#215; 1970 pixels @ 300dpi)</p>

Is this the way it should be working?
(It is not how it works on textile-lang.com.)

Last edited by Kjeld (2019-08-27 01:13:45)


JapaneseStreets.com – Japanese street fashion (mostly txp)
Old Photos of Japan – Japan between 1860 and 1940 (100% txp)
MeijiShowa – Stock photos of Japan between 1860 and 1940 (100% txp)

Offline

#14 2019-08-27 06:47:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,487
Website

Re: Textile does not output

But is it expected behavior that no html is added at all (to the full text) when I add raw html without the space?

Oh, you’re right! 😳 Apologies for misunderstanding above.

If I paste your first example into textile-lang.com, none of the textile notation is processed. As soon as I add a space or a return before <br />, the textile notation is processed. I think you may have discovered a bug or “unintended side effect”.

BTW: The reason previously input Textile still works fine is because textile is processed when you save the article and the resulting html is stored in the database for displaying on your page, reducing processing load on the server and improving speed. That remains unaffected until the next time you save or edit the article. Should you ever want to re-process old articles, there’s the plugin sed_textile_upgrade by netcarver that refreshes the textile output for all articles.


TXP Builders – finely-crafted code, design and txp

Offline

#15 2019-08-27 08:04:51

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 253
Website

Re: Textile does not output

jakob wrote #319156:

Oh, you’re right! 😳 Apologies for misunderstanding above.

If I paste your first example into textile-lang.com, none of the textile notation is processed. As soon as I add a space or a return before <br />, the textile notation is processed. I think you may have discovered a bug or “unintended side effect”.

BTW: The reason previously input Textile still works fine is because textile is processed when you save the article and the resulting html is stored in the database for displaying on your page, reducing processing load on the server and improving speed. That remains unaffected until the next time you save or edit the article. Should you ever want to re-process old articles, there’s the plugin sed_textile_upgrade by netcarver that refreshes the textile output for all articles.

Good to know that it was not something caused by my coding. Although you might not be too happy about this unintended side effect 😉

sed_textile_upgrade is a very helpful tip and will save me a lot of time! Thanks.


JapaneseStreets.com – Japanese street fashion (mostly txp)
Old Photos of Japan – Japan between 1860 and 1940 (100% txp)
MeijiShowa – Stock photos of Japan between 1860 and 1940 (100% txp)

Offline

#16 2019-08-30 18:48:13

Gocom
Plugin Author
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,532
Website

Re: Textile does not output

This has been fixed by PHP-Textile 3.7.3.

Offline

#17 2019-08-30 19:05:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,288
Website

Re: Textile does not output

Gocom wrote #319197:

This has been fixed by PHP-Textile 3.7.3.

A wonderfully minor, but very functional, improvement. Thanks Jukka!!!


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | Respbublika! | NeMe @ github

Offline

#18 2019-08-31 02:32:21

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 253
Website

Re: Textile does not output

Gocom wrote #319197:

This has been fixed by PHP-Textile 3.7.3.

Wonderful. Thank you!


JapaneseStreets.com – Japanese street fashion (mostly txp)
Old Photos of Japan – Japan between 1860 and 1940 (100% txp)
MeijiShowa – Stock photos of Japan between 1860 and 1940 (100% txp)

Offline

Board footer

Powered by FluxBB