I have a client copy an pasting press releases into the blog module. Today when she did so she managed to grab a tag as well.
In my list view I have a the first 15 words of the press release with a liquid | strip_html filter . The actual “” tags were removed, but the content of the style tags were not. So in the preview I say raw CSS. Anybody know a way to strip out the contents of the style tags with liquid?
Also, I thought there was an option to clean HTML in the WYSIWYG editor, but I can’t find it right now.
I’ve previously asked clients to copy and paste text into a notepad/TextEdit. But in this case it doesn’t seem to be working. The style tag stays intact somehow.
Weird that the fix hasn’t worked in this situation though… however it may not be applied to the .NET version Treepl uses… might be worth the devs having a look at this.
Also I personally would stay clear of the above liquid code… You want to keep spans and such… Between the fix and the clear formatting button , it should cover your bases. That and clients previewing their own work before they hit save ha
Yeah, not really what Liquid is designed to do.
Something like this might work though (providing the style tag always comes first there aren’t multiple style tags):
What exactly does that button do? I tried it on a few snippets and it didn’t seem to make much of a difference. It doesn’t strip inline code… it doesn’t do much.
I always assumed it would strip everything and just take you back to base p tags or something.
@Adam.Wilson Thank you for parsing that code. I think I am going to steer clear of it. The client grabs these news releases from a number of places, and so it’s difficult top know exactly what might be in there. There are just too many variables at the end of the day to take into account.
I think the solution might just be more client training.