Expand my Community achievements bar.

Richtext strange behavior with font-size

Avatar

Former Community Member

Hi all.

I'm having an issue with RichText component. For some reason, it's adding a style="font-size:12px" in all my tags.

And because of that, all my text has its size reformatted (even all header tags h1, h2... etc)

Check this out: https://drive.google.com/a/ciandt.com/file/d/0Bz2rzjOB6s2UNk9oQUY4M3N5dlU/view

Has someone had this problem?

Thanks

1 Reply

Avatar

Former Community Member

Hi,

I'm having the same problem and I found out that there's a plugin (KeyPlugin.js) that was created for "fixing" this strange behaviors, in it there's a method to "Handle spans that get inserted deliberately by Webkit.":

handleJunkSpans: function(context) { var com = CUI.rte.Common; var selection = this.editorKernel.createQualifiedSelection(context); if (selection && !selection.isSelection) { var toCheck = selection.startNode; toCheck = (toCheck.nodeType === 3 ? com.getParentNode(context, toCheck) : toCheck); if (com.isTag(toCheck, "span")) { var styleAttrib = com.getAttribute(toCheck, "style", true); if (styleAttrib) { if (styleAttrib.indexOf("font-size") >= 0) { CUI.rte.DomProcessor.removeWithoutChildren(toCheck); } } } } }

But I'm still having problem with styles being added directly on tags.

So I'll ask again, has someone else had this problem?

Thanks in advance,

Marco.