cancel
Showing results forย 
Showย ย onlyย  | Search instead forย 
Did you mean:ย 
Highlighted
Occasional Advisor

Teaser text isn't formatted in overview

Hi guys! 

 

Don't know if you are able to help me, but I will keep my fingers crossed ๐Ÿคž

I noticed that if i bold the text, add links or if I enter a new line the formattings aren't displayed in the overview of the blog posts. I've tested both using the formatting in the toolbar and HTML. 

Is this specific for our community or do you have the same issue? 

 

Snap3.pngSnap4.png

3 Replies 3
Highlighted
Honored Contributor

Hi

That doesn't look right.. 

Screen Shot 2020-07-08 at 4.32.17 pm.png

I checked here and we're seeing the above

I think your content may have been copy and pasted in from another source like MS Word or a web page as it contains span and inline styles.  

What you can do is copy it into Notepad or a simple text editor and then copy and paste it in from here.

Maybe you are editing existing content, in that case you can use the HTML view to clean up and remove all those extra elements, making it more like the screenshot above.

Let us know how you go!

Chris



Highlighted
Occasional Advisor

Thanks for you answer @cblown 

I've done some more investigation here and just as you say, if I copy and paste the text from another source like docs or a web page I get a lot of those extra code strings. But it's pretty similiar when I just write the text myself. 

If I paste the text from Notepad the text in the HTML view is more clean. 

My question is still there though, I can't see the break in the teaser text in the overview. Looks good in the article teaser when I edit the article though. 

Highlighted
Occasional Advisor

I think teaser text renders with html.stripper.from.owasp.newOptionsBuilder.allowElement(String element); method or something similar.

https://developer.khoros.com/khoroscommunitydevdocs/reference/utils-for-manipulating-and-stripping-h...

The utils.html.stripper.from.owasp.newOptionsBuild methods strip some HTML elements from third-party HTML while leaving other third-party HTML elements intact. The methods use the Java library provided from the OWASP Java HTML Sanitizer Project.

 

<#assign stripperOptions = utils.html.stripper.from.owasp.optionsBuilder.allowElement("p").build() />
${utils.html.stripper.from.owasp.strip("<p>p tag will not be stripped</p><div>div tag will be stripped<div>", stripperOptions)}

 

 

So if <br> or other tags is not in allowElement() parameters - they will be stripped (except their content).

As solution, yo can write your own component with parameters that you want.