- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Formatting {{ post.summary }} to remove HTML tags
Jun 28, 2018 4:12 AM
I have this HubL code: {{ post.summary }}. Which, as you know pulls the summary of each blog post and adds it to wherever I put the HubL, in my case for an email.
However, it doesn't just pull the text, it pulls the the text sits it along with it's CSS. I.e.
<span style="font-size: 1.25rem;"> This text here sits in the blog post.</span>
In emails, I do not want the summary to be font-size: 1.25rem, I want it to be 14px.
<p style="font-size: 14px;">{{ post.summary }}</p>
Since rem unit is relative to the font size of the root element. If an element has its font-size set using that unit, then changing the font-size of its parent element is going to have no effect. Which is why I am wondering if there's a way to modify the content of post.summary instead? I.e. format {{ post.summary }} to strip it of any HTML tags?
P.s. Can't use JavaScript since it's for an email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content