Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
txp:image outputs img element with trailing slash
This is my txp tag:
<txp:image class=“article-image” height=“0” width=“0” />
It outputs this HTML:
<img src=“https://pxd.gd/images/23.png” alt=”“ class=“article-image” />
Is there a way to remove the trailing slash from the img element?
Offline
Re: txp:image outputs img element with trailing slash
This and other standalone tags are corrected in the forthcoming 4.9, which is all but ready and certainly usable.
With 4.8, you‘ll need to use a search and replace plugin. Maybe the trim="/>" replace=">"
attributes work on the txp:image tag; I can‘t remember if they work on v4.8. The other option is to write out the img
tag manually abd insert the relevant attributes using txp:image_url
and txp:image_info
.
TXP Builders – finely-crafted code, design and txp
Offline
Re: txp:image outputs img element with trailing slash
jakob wrote #339884:
This and other standalone tags are corrected in the forthcoming 4.9, which is all but ready and certainly usable.
Sounds like maybe installing the latest 4.9 might be the way to go.
Last edited by agovella (2025-06-21 21:59:30)
Offline
Re: txp:image outputs img element with trailing slash
I installed the 4.9 beta, and like magic, all the trailing slashes in my img tags disappeared.
Smooth installation, too. And everything seems to be working.
Offline
Re: txp:image outputs img element with trailing slash
jakob wrote #339884:
This and other standalone tags are corrected in the forthcoming 4.9, which is all but ready and certainly usable.
jakob is correct, we’re close to release for 4.9.0…there are some issues outstanding but the list is getting shorter.
Offline