From acef7ca2788c6d98938335d69580d6d64f20efde Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Fri, 5 Jun 2020 11:40:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-33027=20=E6=97=A0=E6=8F=92=E4=BB=B6P?= =?UTF-8?q?DF=E5=AF=BC=E5=87=BA-HTML=E8=A7=A3=E6=9E=90=EF=BC=9A=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20=E3=80=81=E3=80=81=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2/lowagie/text/html/simpleparser/FactoryProperties.java | 1 + .../fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 b2e3ccf4f..dd1d9f3d4 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 @@ -472,5 +472,6 @@ public class FactoryProperties { followTags.put("strong", "b"); followTags.put("s", "s"); followTags.put("strike", "s"); + followTags.put("del", "s"); } } 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 a3558dab3..eeafc9659 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 @@ -821,7 +821,7 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener { return true; } - public static final String tagsSupportedString = "ol ul li a pre font span br p div body table td th tr i b u sub sup em strong s strike" + public static final String tagsSupportedString = "ol ul li a pre font span br p div body table td th tr i b u sub sup em strong s strike del" + " h1 h2 h3 h4 h5 h6 img hr"; public static final HashMap tagsSupported = new HashMap(); From 49b931e8ca491eba6a44432c76458645b76d7194 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Fri, 5 Jun 2020 11:57:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-33032=20=E6=97=A0=E6=8F=92=E4=BB=B6P?= =?UTF-8?q?DF=E5=AF=BC=E5=87=BA-HTML=E8=A7=A3=E6=9E=90=EF=BC=9Afont-size?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81=E5=8D=95=E4=BD=8D=20%=EF=BC=8Ctext-decora?= =?UTF-8?q?tion=20=E6=94=AF=E6=8C=81line-through=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/third/v2/lowagie/text/html/Markup.java | 3 +++ .../lowagie/text/html/simpleparser/FactoryProperties.java | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/Markup.java b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/Markup.java index 133c20a32..6137f1326 100644 --- a/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/Markup.java +++ b/fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/Markup.java @@ -399,6 +399,9 @@ public class Markup { if (string.startsWith("em")) { return f * actualFontSize; } + if (string.startsWith("%")) { + return f * actualFontSize / 100; + } // one ex is the x-height of a font (x-height is usually about half the // font-size) if (string.startsWith("ex")) { 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 dd1d9f3d4..a8a89b93d 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 @@ -389,8 +389,13 @@ public class FactoryProperties { h.put("b", null); } else if (key.equals(Markup.CSS_KEY_TEXTDECORATION)) { String ss = prop.getProperty(key).trim().toLowerCase(); - if (ss.equals(Markup.CSS_VALUE_UNDERLINE)) + if (ss.equals(Markup.CSS_VALUE_UNDERLINE)) { h.put("u", null); + } else if (ss.equals(Markup.CSS_VALUE_LINETHROUGH)) { + h.put("s", null); + } else { + h.put(key, ss); + } } else if (key.equals(Markup.CSS_KEY_COLOR)) { Color c = Markup.decodeColor(prop.getProperty(key)); if (c != null) {