Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.8 M2
-
None
-
Unit
-
Description
I encountered this issue with the following oo generated html fragment:
<FONT SIZE=5 STYLE="font-size: 20pt">PakData.net Online Exams</FONT>
Now I don't know why OO generates such html content but what it means (in oo writer and the generated html) is that the font size is 20pt. The additional size=5 is just meant to make our lives worse I guess. Anyway, currently the DefaultHTMLCleaner does following transformation which strips off the style attribute:
tt = new TagTransformation(HTMLConstants.FONT, HTMLConstants.SPAN, false); tt.addAttributeTransformation(HTMLConstants.STYLE_ATTRIBUTE, "color:${color};font-family=${face};font-size=${size}pt;"); defaultTransformations.addTransformation(tt);
Now the easiest method to fix this issue is to do the following instead:
tt = new TagTransformation(HTMLConstants.FONT, HTMLConstants.SPAN, false); tt.addAttributeTransformation(HTMLConstants.STYLE_ATTRIBUTE, "color:${color};font-family=${face};font-size=${size}pt;${style}"); defaultTransformations.addTransformation(tt);
This gives the precedence to the final ${style} segment over those before it (at least on FF) and the generated XWiki 2.0 code also renders with font-size 20pt. Still, I'm not sure whether this is the right way to fix it, therefor I'm waiting for others to comment on this issue.
Attachments
Issue Links
- relates to
-
XWIKI-3295 Font size are not handled properly
- Closed