Randomly placed <em> tags on website

SOLVE
bee_robot
Participant

Hello everybody,

 

I was tasked to look into an isue with our business startpage: https://hub.beesmart.city/en/
It was discovered yesterday and as far as I know, no changes have been made to this site, the template or the stylesheet since at least a week.
The issue is, that some text is italic, even though it shouldn't be and upon further investigation the html document has a lot of randomly placed <em> tags. One even contains whole modules.

This is clearly the source of the problem: https://www.techonthenet.com/html/elements/em_tag.php#targetText=The%20HTML%20tag%20marks,as%20the%2...
It also means that it is definitelly not the css.


The problem I face now. How do I fix this? Where do the tags come from?
I can't edit the HTML of a Site directly and the modules that are infested with the <em> tags don't actually have them in their source code.

I once updated the template (changed a trivial thing) and that could have possibly gotten rid of some, but I'm not sure. There are definitelly still many and strangely placed, too as seen in this image.

image.png

It also appears that it's part of the template, because a translated version of this website exists (created and reviewed before the <em> elements appeared) and it also has them.

 

According to the support, we are the only one who are having this issue right now, but if anyone here has a clue on what is going on or what I could do to fix this, please respond.

 

Thank you and have a good day everybody.

 

// UPDATE //
Just 5 minutes later I found the source.
An Editor made a paragraph italic through, I assume, the rich text editor and that was loaded into the startpage via a module. That somehow made the rest of the site italic.
I assume, just like @MatthewShepherd said that an <em> tag was opened, but not closed, maybe due to the truncate filter used in the module.

To fix it, we simply removed the formatting of the first few paragraphs in the blog that had them. Then switched the "truncate" filter to "truncatehtml" to make sure this won't happen again in thefuture.

 

The issue is therefor solved in my opinnion, but maybe this can be helpful to people in the future, which is why I won't delete it now.

Thank you for looking into this issue with me.

1 Accepted solution

Accepted Solutions
MatthewShepherd
Solution
HubSpot Employee

@bee_robot 

 

I'm not sure if this is the source of your issue but I have seen this kind of thing happen in the past where browser plugins such as spell checkers highlight what it considers spelling and grammar issues in your content but the HTML the plugin uses to highlight the text gets saved in your template HTML (so best to test disabling these plugins if you have them).

 

As some entire modules appear to be wrapped in <em> tags I'd imagine this must be coming from some component of your template. The first <em> tag shows up in the Related Blog Post module so that's the most likely source (unclosed em tags here could cause em tags to appear elsewhere). Can you share the template code for this module? (Screenshot or paste using insert code feature in the community form text editor)


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional

View solution in original post

3 Replies 3
MatthewShepherd
Solution
HubSpot Employee

@bee_robot 

 

I'm not sure if this is the source of your issue but I have seen this kind of thing happen in the past where browser plugins such as spell checkers highlight what it considers spelling and grammar issues in your content but the HTML the plugin uses to highlight the text gets saved in your template HTML (so best to test disabling these plugins if you have them).

 

As some entire modules appear to be wrapped in <em> tags I'd imagine this must be coming from some component of your template. The first <em> tag shows up in the Related Blog Post module so that's the most likely source (unclosed em tags here could cause em tags to appear elsewhere). Can you share the template code for this module? (Screenshot or paste using insert code feature in the community form text editor)


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional

View solution in original post

bee_robot
Participant

Your first guess sounds logical, but it was your second that was actually right.
The formatting of the blog post was causing this issue. I assume it's because I used the truncate filter to display only the first 155 words of a blog article and this cuts off ending tags as well.

Now we must avoid using rich text formatting or I need to find out how I can edit the template so that it doesn't cut off tags.

0 Upvotes
MatthewShepherd
HubSpot Employee

@bee_robot great, glad you found the source of the issue.


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes