Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-03-31 07:50:55

hildebruns
Member
Registered: 2009-03-10
Posts: 35

Breaks in body_html

Hi,

I have “Leave text untouched” in the publish settings. Now when I save an article, <br> are automatically displayed. In the database, I saw that there are <br> elements in the “body_html” field. It shouldn’t be like that, should it? TXP 4.8.7

Last edited by hildebruns (2022-03-31 07:51:38)

Offline

#2 2022-03-31 13:03:22

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

Re: Breaks in body_html

Do i understand correctly, you see some <br> displayed when viewing the article from the public side? That should not happen with the setting you mention, unless you inserted them manually.

Does turning ‘ON’ debug mode (Preferences > Site) reveals anything?
Do you happen to use plugins that might interact with the content of the <textarea /> on the Write tab?


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

Offline

#3 2022-03-31 16:43:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: Breaks in body_html

I had a similar but opposite problem recently in the textile enabled excerpt field where textile was not recognised and I had to use html tags to produce the result.

This did not work

_Sublime/Internal/Subliminal_

neither did this

_Sublime&#47;Internal&#47;Subliminal_

but this did

<em>Sublime&#47;Internal&#47;Subliminal</em>

php v7.4.25
txp v4.8.8


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2022-04-01 06:30:44

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

Re: Breaks in body_html

Colak –

That is odd too. And it works perfectly fine here.
PHP 8 and 8.1 with Textpattern 4.8.8.


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

Offline

#5 2022-04-01 07:37:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: Breaks in body_html

phiw13 wrote #333037:

Colak –

That is odd too. And it works perfectly fine here.
PHP 8 and 8.1 with Textpattern 4.8.8.

gremlins:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2022-04-04 04:30:27

hildebruns
Member
Registered: 2009-03-10
Posts: 35

Re: Breaks in body_html

phiw13 wrote #333034:

Do i understand correctly, you see some <br> displayed when viewing the article from the public side? That should not happen with the setting you mention, unless you inserted them manually.

Yes, a <br> will be inserted automatically. I assume this is normal for the “Convert line breaks” setting. But with “leave text untouched” it should remain empty.

Does turning ‘ON’ debug mode (Preferences > Site) reveals anything?

No, same problem.

Do you happen to use plugins that might interact with the content of the <textarea /> on the Write tab?

Yes, but I disabled the plugin and it’s the same problem.

I have updated Textpattern to Version 4.8.8., PHP Version 7.0.33

Offline

#7 2022-04-04 08:15:11

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

Re: Breaks in body_html

Just checking, but I presume the formatting for the article in question hasn’t been overridden to Convert line breaks?

I tested it on the online demo and couldn’t make it happen. I wondered if the formatting in body_html was left over from an earlier article setting, but from testing it does seem that saving with Leave text untouched also resets Body_html:

To test that on the online demo (4.8.8) site I added:

<txp:php>
global $thisarticle;
$Body=safe_field("Body_html", 'textpattern', "`ID`= ". $thisarticle['thisid']);
echo '<pre><code>' . htmlspecialchars($Body) . '</code></pre>';
</txp:php>

after <txp:body /> in the Default form, and then tried two articles with Leave text untouched and Convert line breaks and then tried switching back between them. The output of Body_html is overwritten.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2022-04-04 08:16:15

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

Re: Breaks in body_html

Yes, but I disabled the plugin and it’s the same problem.

Did you save the article again after disabling the plugin (eventually after changing something, however minimal)? That would I think, rewrite body_html in the DB.


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

Offline

#9 2022-04-04 09:05:56

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

Re: Breaks in body_html

jakob wrote #333041:

To test that on the online demo (4.8.8) site I added: <txp:php>...

FWIW, <txp:body escape /> should produce the same (up to parsing) result.

Offline

#10 2022-04-05 07:36:24

hildebruns
Member
Registered: 2009-03-10
Posts: 35

Re: Breaks in body_html

Now I have the solution. I had set the “Leave text untouched” setting after writing articles. At the same time I had hidden the format setting in the article. So I still had the old format setting in the existing articles. Many thanks for the help!

Offline

#11 2022-04-09 23:10:54

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 112
Website

Re: Breaks in body_html

OMG – Thank you for solving a completely different problem for me.

I’ve been having an extra <BR> on each paragraph in my articles for years, after I upgraded hak_tinymce. I eventually decided to just live with it.

Now that I changed the setting to “Leave text untouched” on Prefs, all is good now.

Offline

Board footer

Powered by FluxBB