Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2025-01-30 20:45:41

mwr
Member
From: Canada
Registered: 2006-01-31
Posts: 169
Website

Open graph description has HTML in it

When I share a post from my blog to Bluesky, the content has HTML in it.

Here’s the tag I’m using:
<meta property=“og:description” content=”<txp:excerpt />” />

Is there a way to fix this?


Mark

Offline

#2 2025-01-30 21:25:39

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

Re: Open graph description has HTML in it

Maybe this:

<meta property="og:description" content="<txp:excerpt escape='tags, html' />" />

Offline

#3 2025-01-30 22:14:38

mwr
Member
From: Canada
Registered: 2006-01-31
Posts: 169
Website

Re: Open graph description has HTML in it

Thanks, that worked. I had tried escaping html, but not tags.


Mark

Offline

#4 2025-01-31 06:12:29

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

Re: Open graph description has HTML in it

etc wrote #338975:

Maybe this:

<meta property="og:description" content="<txp:excerpt escape='tags, html' />" />...

I escape textile too.

<meta property="og:description" content="<txp:excerpt escape='textile,tags,html' />" />

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

Offline

#5 2025-01-31 17:16:17

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

Re: Open graph description has HTML in it

Hi Yiannis, I don’t think you need to escape textile in that case. To my knowledge <txp:excerpt /> tag outputs the excerpt_html field from the database. As that has already been pre-rendered as html, it won’t contain any textile.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2025-02-01 10:39:17

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

Re: Open graph description has HTML in it

jakob wrote #338979:

Hi Yiannis, I don’t think you need to escape textile in that case. To my knowledge <txp:excerpt /> tag outputs the excerpt_html field from the database. As that has already been pre-rendered as html, it won’t contain any textile.

You are absolutely right!!!


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

Offline

Board footer

Powered by FluxBB