Browse Source

Pull request #474: REPORT-33908 HTML高度计算异常(br、hr 标签中的line-height属性不应该生效)

Merge in CORE/base-third from ~HUGH.C/base-third:release/10.0 to release/10.0

* commit '65bf0880d34c416257cd49a4b1bf2be209d3ba83':
  REPORT-33908 HTML高度计算异常(br、hr 标签中的line-height属性不应该生效)
release/10.0
ju.ju 4 years ago
parent
commit
2c80f006e3
  1. 6
      fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java
  2. 2
      fine-itext/src/main/java/com/fr/third/v2/lowagie/text/xml/simpleparser/SimpleXMLParser.java

6
fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java

@ -244,8 +244,7 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
}
if (tag.equals(HtmlTags.NEWLINE)) {
if (currentParagraph == null) {
currentParagraph = FactoryProperties
.createParagraph(cprops);
currentParagraph = new Paragraph();
}
currentParagraph.add(factoryProperties
.createChunk("\n", cprops));
@ -258,8 +257,7 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
// end with a break, but a trailing break is always inserted.
boolean addLeadingBreak = true;
if (currentParagraph == null) {
currentParagraph = FactoryProperties
.createParagraph(cprops);
currentParagraph = new Paragraph();
addLeadingBreak = false;
}
if (addLeadingBreak) { // Not a new paragraph

2
fine-itext/src/main/java/com/fr/third/v2/lowagie/text/xml/simpleparser/SimpleXMLParser.java

@ -494,7 +494,7 @@ public final class SimpleXMLParser {
if (c == -1) {
return;
}
if (c == '/' || HTMLWorker.tagsPrefixSupported.containsKey(c)) {
if (c == '/' || HTMLWorker.tagsPrefixSupported.containsKey(Character.toLowerCase(c))) {
if (type == TEXT) {
flush();
}

Loading…
Cancel
Save