Fix regression of #3573. Refactor the code.

This commit is contained in:
Emanuel Schütze 2018-02-12 11:05:29 +01:00 committed by FinnStutzenstein
parent 3ddc73b0a0
commit bdd65d90b8

View File

@ -817,12 +817,6 @@ angular.module('OpenSlidesApp.core.pdf', [])
hasClass(element, 'os-line-break') && hasClass(element, 'os-line-break') &&
hasClass(brParent, 'os-split-before'))) { hasClass(brParent, 'os-split-before'))) {
break; break;
} else if (element.nextSibling.nodeName === 'BR') {
// Add a dummy line, if the next tag is a BR tag again.
currentParagraph = create('text');
currentParagraph.lineHeight = 1.25;
currentParagraph.text.push(create('text', ' '));
alreadyConverted.push(currentParagraph);
} else { } else {
currentParagraph = create("text"); currentParagraph = create("text");
if (lineNumberMode === "outside" && if (lineNumberMode === "outside" &&
@ -830,6 +824,11 @@ angular.module('OpenSlidesApp.core.pdf', [])
element.parentNode.parentNode.nodeName !== "LI") { element.parentNode.parentNode.nodeName !== "LI") {
currentParagraph.margin = [20, 0, 0, 0]; currentParagraph.margin = [20, 0, 0, 0];
} }
// Add a dummy line, if the next tag is a BR tag again. The line could
// not be empty otherwise it will be removed and the empty line is not displayed
if (element.nextSibling && element.nextSibling.nodeName === 'BR') {
currentParagraph.text.push(create('text', ' '));
}
currentParagraph.lineHeight = 1.25; currentParagraph.lineHeight = 1.25;
alreadyConverted.push(currentParagraph); alreadyConverted.push(currentParagraph);
} }