Browse Source

Pull request #462: REPORT-32592 html 以<a>、<br> or <hr> 标签开头时,丢失line-height属性

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

* commit 'a0304dcde3de021cf5a88b89a5732dfbd78861d0':
  REPORT-32592 html 以<a>、<br> or <hr> 标签开头时,丢失line-height属性
release/10.0
Abby 4 years ago
parent
commit
d68cfa5a64
  1. 12
      fine-itext/src/main/java/com/fr/third/v2/lowagie/text/html/simpleparser/HTMLWorker.java

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

@ -228,7 +228,8 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
if (tag.equals(HtmlTags.ANCHOR)) {
cprops.addToChain(tag, h);
if (currentParagraph == null) {
currentParagraph = new Paragraph();
currentParagraph = FactoryProperties
.createParagraph(cprops);
}
stack.push(currentParagraph);
currentParagraph = new Paragraph();
@ -236,7 +237,8 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
}
if (tag.equals(HtmlTags.NEWLINE)) {
if (currentParagraph == null) {
currentParagraph = new Paragraph();
currentParagraph = FactoryProperties
.createParagraph(cprops);
}
currentParagraph.add(factoryProperties
.createChunk("\n", cprops));
@ -249,7 +251,8 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
// end with a break, but a trailing break is always inserted.
boolean addLeadingBreak = true;
if (currentParagraph == null) {
currentParagraph = new Paragraph();
currentParagraph = FactoryProperties
.createParagraph(cprops);
addLeadingBreak = false;
}
if (addLeadingBreak) { // Not a new paragraph
@ -545,7 +548,8 @@ public class HTMLWorker implements SimpleXMLDocHandler, DocListener {
}
if (tag.equals("a")) {
if (currentParagraph == null) {
currentParagraph = new Paragraph();
currentParagraph = FactoryProperties
.createParagraph(cprops);
}
boolean skip = false;
if (interfaceProps != null) {

Loading…
Cancel
Save