From bdd65d90b8b66213882d4ced7063ba829b64d854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Mon, 12 Feb 2018 11:05:29 +0100 Subject: [PATCH] Fix regression of #3573. Refactor the code. --- openslides/core/static/js/core/pdf.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index fb83939b5..234df7ed2 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -817,12 +817,6 @@ angular.module('OpenSlidesApp.core.pdf', []) hasClass(element, 'os-line-break') && hasClass(brParent, 'os-split-before'))) { 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 { currentParagraph = create("text"); if (lineNumberMode === "outside" && @@ -830,6 +824,11 @@ angular.module('OpenSlidesApp.core.pdf', []) element.parentNode.parentNode.nodeName !== "LI") { 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; alreadyConverted.push(currentParagraph); }