Browse Source

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

release/10.0
Hugh.C 5 years ago
parent
commit
65bf0880d3
  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