Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-06-15 09:28:39

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

<img> sometimes in a <p> tag ... sometimes not ... !?

On this site sometimes <img> tags are enclosed with <p> tags … and on other pages the <img> is a standalone tag … !? This gives margin problems (whitespace). Textpattern has version 4.7.3

A known issue?

Last edited by RedFox (2019-06-15 09:29:22)

Offline

#2 2019-06-15 10:40:25

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

Re: <img> sometimes in a <p> tag ... sometimes not ... !?

A wild guess: was the site updated from an earlier version of textpattern?

Depending on how you are inserting your images, previous versions wrapped an html tag starting at the beginning of the line in a <p> tag. To avoid that you had to start the line with a space or with notextile..

More recent versions of textpattern (I forget exactly when but 4.7+) no longer wrap tags in a p.

That could be an explanation if you are seeing the <p><img … ></p> in older articles but not in more recent ones since the upgrade. That’s pure conjecture but maybe it mirrors what you’re seeing…

Because the site uses the pre-rendered html from the textile, the ‘older’ articles will show how they were. Once you re-save them, the behaviour will change.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2019-06-15 10:42:48

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

Re: <img> sometimes in a <p> tag ... sometimes not ... !?

BTW: If you’re going to rejig the articles anyway, you might like to use this image with caption shortcode to get proper figure … figcaption markup.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2019-06-15 11:26:05

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,667
Website

Re: <img> sometimes in a <p> tag ... sometimes not ... !?

As Jacob alludes, there were some changes in TXP 4.7.3 / Textile related to wrapping things in <p /> tags or not.

All depends if your images are inserted on their own line in the source preceded by a space or not

Offline

#5 2019-06-15 14:00:55

etc
Developer
Registered: 2010-11-11
Posts: 3,170
Website

Re: <img> sometimes in a <p> tag ... sometimes not ... !?

jakob wrote #318480:

More recent versions of textpattern (I forget exactly when but 4.7+) no longer wrap tags in a p.

Phrasing tags should still be wrapped in <p></p>. Weirdly, <img /> seems to fail.


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

Offline

#6 2019-06-15 15:48:03

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

Re: <img> sometimes in a <p> tag ... sometimes not ... !?

Oké … thanks all. Is there a way to (re)save all (live) articles at once? Via the database perhaps?

@jakob … I will make a proposal to my client … :)

[edit]
After resaving a number of articles some <p> tags are gone but, unfortunately, some stay where they are … :(

Last edited by RedFox (2019-06-15 19:00:35)

Offline

#7 2019-06-16 16:59:13

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

Re: <img> sometimes in a <p> tag ... sometimes not ... !?

RedFox wrote #318486:

Is there a way to (re)save all (live) articles at once?

There’s sed_textile_upgrade. That makes a copy of the textpattern table in the DB and then batch textiles all body and excerpt fields in the DB.

This is an updated version for Textpattern v4.7 (also on github):

# sed_textile_upgrade v0.2
# Facilitates textile upgrades to your Textpattern v4.7+ article body and excerpt texts
# Netcarver + jcr
# https://github.com/jools-r/sed_textile_upgrade

# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................

H4sIAAAAAAAAE+1Y21LbShZ9tr+io1Cx4YBsAwmJsBkucc6hQkiKuCYzdZIybaltdZDVitSy
caWoOv8wT/N750tm7W7JF3Auz1OhkgL1Ze+1175K3Gvtel8z78BzJiLNpIqdw8zb85ymu0t/
PfMcnutQpfTQeuo5l0L7PMVZ9hv77NvlZnmon6eSVvZxLdQ6ybxGYyR1mA9cX40bn5WKsp20
kYmgr8WtlpHo58ko5YEwclqeE4jMT2WiCyDPofEV92UkNdciY8UtVtzCgmIzlaesh42Eay3S
mE323YPfGE+19HF0oIIZ43HAxK0v0kQbGRkJh2yVBgI2SK9FqD1HzxJBj3t2exjxUUbPu3Y7
5mOL9IXnfMMInApFlJhTu3uQEbZctuZstbr1Sq3DreJotlWtnnLth8xXMajWGeNRZA3NpBal
bRkb8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KlpVmcOrVasQebPyvX5y+ttdn2KOKPfpfGD4rlr
38mXt8RiqUeT0bURRNxYiauVv1L58Ef3qmu3aq0a0KwqwcsNu7deajCXnGUOaYVYfESzAXFs
DNws2axslPR0TLf6uDQtfyxeOD++MzNy3XikUqHKzf2wFIWWuiHjoZpLNOpayCm7/mdtGXzt
0+IcgkvoPz9ReBGZfcpYmg+QdQ5zUa7eI/tJTyFg58gM6/VS7qmVhx8yx2VOzbEIK3fV7yMp
6CIwD6AU/rNofhZKdyFwAaU6lww5cpxE6CV1RpM8TdtYLQi9nw323QUnl+KiuLKNTHyJc18L
vecva5/unNWcwU8e42x9RQlNoZU7JiI0ZMs/jfnMuVRlZ1u8gVKAFRRl9nV6qPI4cC29JGlZ
kJVzVnwM0GypVCCzzB1cWbpx/8JyiStuUJk2dZO9sm/x28BhP/0EeD9Pcx9v23FE862xfERN
zeZ7IFPh63IqKT+ZmVClOYdyHYIN0YGIhCX6NukXhR4MX1Njuu6se3GrOQ/q5aPy2dhmvqOg
vahBX8RBH6p5XN+0TqCihDSqXSjfjHUeq7k8zN3avNf+wzSeDoGtrVw5U3EsfHvJj1QmHmzT
lLBzIeIR3nhY02zfVe/MB0f7+a6f8umvT3i/PuH9+oT36xPe/+0nvD3PGQdPzV+7nnOwt/ss
eOEHe8GQ7z9vDgat1uDZ/rNmc3AwbImDF87h3f8AnMrFVi0aAAA=

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB