diff --git a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java index 28deb3e61..39b06af14 100644 --- a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java +++ b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/FactoryProperties.java @@ -462,20 +462,30 @@ public class FactoryProperties { dealWithFontSizeOrTextIndent(h, cprops, prop, key); } else if (key.equals(Markup.CSS_KEY_FONTSTYLE)) { String ss = prop.getProperty(key).trim().toLowerCase(); - if (ss.equals("italic") || ss.equals("oblique")) + if (ss.equals("italic") || ss.equals("oblique")) { h.put("i", null); + } else { + h.remove("i"); + } } else if (key.equals(Markup.CSS_KEY_FONTWEIGHT)) { String ss = prop.getProperty(key).trim().toLowerCase(); if (ss.equals("bold") || ss.equals("700") || ss.equals("800") - || ss.equals("900")) + || ss.equals("900")){ h.put("b", null); + }else { + h.remove("b"); + } } else if (key.equals(Markup.CSS_KEY_TEXTDECORATION)) { String ss = prop.getProperty(key).trim().toLowerCase(); if (ss.equals(Markup.CSS_VALUE_UNDERLINE)) { + h.remove("s"); h.put("u", null); } else if (ss.equals(Markup.CSS_VALUE_LINETHROUGH)) { + h.remove("u"); h.put("s", null); } else { + h.remove("u"); + h.remove("s"); h.put(key, ss); } } else if (key.equals(Markup.CSS_KEY_COLOR)) { diff --git a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java index 18f5b59eb..a1a9da464 100644 --- a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java +++ b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java @@ -215,12 +215,15 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener { h.put(Markup.CSS_KEY_MARGINTOP, "16px"); h.put(Markup.CSS_KEY_MARGINBOTTOM, "16px"); } + if (tag.equals("th")) { + h.put("b", null); + } String follow = (String) FactoryProperties.followTags.get(tag); if (follow != null) { HashMap prop = new HashMap(); prop.put(follow, null); - FactoryProperties.insertStyle(h, this.cprops); prop.putAll(h); + FactoryProperties.insertStyle(prop, this.cprops); cprops.addToChain(follow, prop); return; } @@ -491,9 +494,6 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener { endElement(tag); skipText = false; pendingTD = true; - if (tag.equals("th")) { - h.put("b", null); - } cprops.addToChain("td", h); stack.push(new IncCell(tag, cprops)); return;