CMS Development

cabplanalp
Participant

HubL remove HTML formatting on Blog content for teaser

I have a blog template that is pulling in individual blog post content in a list of blog post using this HubL:

 

{{ topic_post.post_list_content|safe }}

 

However, this also pulls in the

<a href>

for links so what is the HubL to remove this HTML formatting? I want to pull the content in but as plain text. I have the same post in this HS community:

 

https://integrate.hubspot.com/t/hubl-how-to-remove-all-html-formatting-pulling-in-post-content-for-t...

 

EDITED:

I found a solution right after I submitted the question, here is a " | striptags" HubL filter: 

After applying this filter, it stripped the HTML tags:

{{ topic_post.post_list_content|safe|striptags }}

 

1 Reply 1
roisinkirby
HubSpot Product Team
HubSpot Product Team

HubL remove HTML formatting on Blog content for teaser

Thanks for sharing the solution @cabplanalp!

0 Upvotes