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 5 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 (tag.equals(HtmlTags.NEWLINE)) {
if (currentParagraph == null) { if (currentParagraph == null) {
currentParagraph = FactoryProperties currentParagraph = new Paragraph();
.createParagraph(cprops);
} }
currentParagraph.add(factoryProperties currentParagraph.add(factoryProperties
.createChunk("\n", cprops)); .createChunk("\n", cprops));
@ -258,8 +257,7 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
// end with a break, but a trailing break is always inserted. // end with a break, but a trailing break is always inserted.
boolean addLeadingBreak = true; boolean addLeadingBreak = true;
if (currentParagraph == null) { if (currentParagraph == null) {
currentParagraph = FactoryProperties currentParagraph = new Paragraph();
.createParagraph(cprops);
addLeadingBreak = false; addLeadingBreak = false;
} }
if (addLeadingBreak) { // Not a new paragraph 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) { if (c == -1) {
return; return;
} }
if (c == '/' || HTMLWorker.tagsPrefixSupported.containsKey(c)) { if (c == '/' || HTMLWorker.tagsPrefixSupported.containsKey(Character.toLowerCase(c))) {
if (type == TEXT) { if (type == TEXT) {
flush(); flush();
} }

Loading…
Cancel
Save