Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-04-30 18:42:23

david@druna.cz
Member
Registered: 2017-07-25
Posts: 41

txt_quote_single_close left after <txp:yield escape="textile" />

I made a shortcode and I want to format the contained text according to Textile. However a quote sign ‘ is gets displayed in the result string as plain text txt_quote_single_close. When I write this quote in an article with textile turned on, it gets displayed properly. The article from which I call this shortcode has textile turned off and the line where I fetch the inner shortcode content (which should format it I suppose) is:

<txp:php>
$formattedContent = parse('<txp:yield escape="textile" />');
...

I discovered that adding html before textile in the following way makes it display right.

<txp:php>
$formattedContent = parse('<txp:yield escape="html,textile" />');
...

I cannot completely wrap my head around what is happening. Also I’m a bit concerned whether the user of the shortcode will still be able to write HTML and TXP tags inside the content.

According to my testing it does mess up any html code (txp tags seems to work though). How can I fetch the content so that it behaves exactly as in an article body?

Last edited by david@druna.cz (2020-04-30 18:55:54)

Offline

#2 2020-04-30 19:28:20

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

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Sorry, can not reproduce (or do not understand) the issue. My setup:

  • A test form
<txp:php>
echo parse('<txp:yield escape="textile" />');
</txp:php>
  • An article
<txp::test>
O'key 'doc' !
</txp::test>

I’m getting

<p>O&#8217;key ‘doc’ !</p>

Is this not expected?

Offline

#3 2020-05-01 10:07:57

david@druna.cz
Member
Registered: 2017-07-25
Posts: 41

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322756:

Sorry, can not reproduce (or do not understand) the issue. My setup:

  • A test form

<txp:php>...

  • An article

<txp::test>...

I’m getting

<p>O&#8217;key ‘doc’ !</p>...

Is this not expected?

With your example I get

<p>O’key txt_quote_single_opendoctxt_quote_single_close !</p>

I run Textpattern version 4.8.0

Last edited by david@druna.cz (2020-05-01 10:08:33)

Offline

#4 2020-05-01 10:17:27

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

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Weird. I have retested it on demo site and it works fine. It looks like txp does not find text strings in your setup, but if they were missing you would have noticed it well before. Does disabling plugins help?

Offline

#5 2020-05-01 10:29:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Very odd. What language are you using and are the strings for quote characters translated in that language?

<txp:php>
$siteLang = get_pref('language');
dmp($siteLang, safe_rows('name, data', 'txp_lang', "lang='$siteLang' and name like 'txt%'"));
</txp:php>

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

#6 2020-05-01 10:29:36

david@druna.cz
Member
Registered: 2017-07-25
Posts: 41

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322762:

Weird. I have retested it on demo site and it works fine. It looks like txp does not find text strings in your setup, but if they were missing you would have noticed it well before. Does disabling plugins help?

The same string displays just fine when I write it in a Textile-enabled article. I’m a bit reluctant about turning off plugins as that would break the website for people. Is there any way to diagnose further from my side?

Offline

#7 2020-05-01 10:34:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Wait, this is repeatable on my dev site if Textile is disabled in the body. But it’s fine on a vanilla install.

What’s going on? Gotta be a plugin.

Last edited by Bloke (2020-05-01 10:36:56)


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

#8 2020-05-01 10:36:34

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

Re: txt_quote_single_close left after <txp:yield escape="textile" />

You can test something like

echo gTxt('txt_quote_single_open');

in your form, to be sure that the problem does not come from parse().

Offline

#9 2020-05-01 10:38:19

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

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Bloke wrote #322765:

Wait, this is repeatable on my dev site if Textile is disabled in the body.

What’s going on?

No difference on the demo site, Textile or not everything works fine.

Offline

#10 2020-05-01 10:40:45

david@druna.cz
Member
Registered: 2017-07-25
Posts: 41

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Bloke wrote #322765:

Wait, this is repeatable on my dev site if Textile is disabled in the body. But it’s fine on a vanilla install.

What’s going on? Gotta be a plugin.

I tried disabling plugins one by one and it didn’t help. For the record – I updated rather recently from 4.6.2 straight to 4.8.0.

Last edited by david@druna.cz (2020-05-01 10:42:19)

Offline

#11 2020-05-01 10:44:06

david@druna.cz
Member
Registered: 2017-07-25
Posts: 41

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322766:

You can test something like

echo gTxt('txt_quote_single_open');...

in your form, to be sure that the problem does not come from parse().

echo gTxt('txt_quote_single_open');

outputs

txt_quote_single_open

Offline

#12 2020-05-01 10:49:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322766:

You can test something like echo gTxt('txt_quote_single_open');... in your form, to be sure that the problem does not come from parse().

On my dev site, I get txt_quote_single_open returned. English on both admin and public site. Doesn’t matter if I have all plugins disabled BUT interestingly, if there are any plugins loaded from the cache directory – any public plugin at all – this bug is triggered.

What. The. Actual…


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

Board footer

Powered by FluxBB