Fix: empty line duplication bug

to reproduce:
hit: a<enter><enter>b
the result will be: a<br><br><br>b
the empty line is two lines high
This commit is contained in:
hunbernd 2015-07-14 22:41:11 +02:00
parent caa97cce70
commit 0402e53f15

View File

@ -681,7 +681,8 @@ static void optimizeHtml(QDomDocument& doc, QDomElement& currentElement, unsigne
// remove Qt standard <p> or empty <p> // remove Qt standard <p> or empty <p>
index += element.childNodes().length(); index += element.childNodes().length();
removeElement(currentElement, element); removeElement(currentElement, element);
addBR = true; // do not add extra <br> after empty paragraph, the paragraph already contains one
addBR = ! style.startsWith("-qt-paragraph-type:empty");
continue; continue;
} }