From 259e338b17ce22130da647f6d2f429a1d3d81958 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 8 Mar 2017 10:22:58 +0100 Subject: [PATCH 1/2] fix double PDF Head in Motions (fixes #3025) --- openslides/core/static/js/core/pdf.js | 33 +++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index a81b861ac..5948dbbdd 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -531,10 +531,35 @@ angular.module('OpenSlidesApp.core.pdf', []) case "h4": case "h5": case "h6": - currentParagraph = create("text"); - currentParagraph.marginBottom = 4; - currentParagraph.marginTop = 10; - /* falls through */ + // Special case quick fix to handle the dirty HTML format*/ + // see following issue: https://github.com/OpenSlides/OpenSlides/issues/3025 + if (lineNumberMode === "outside") { + var HeaderOutsideLineNumber = { + width: 20, + text: element.childNodes[0].getAttribute("data-line-number"), + color: "gray", + fontSize: 8, + margin: [0, 2, 0, 0] + }; + var HeaderOutsideLineNumberText = { + text: element.childNodes[1].textContent, + }; + ComputeStyle(HeaderOutsideLineNumberText, elementStyles[nodeName]); + var HeaderOutsideLineNumberColumns = { + columns: [ + HeaderOutsideLineNumber, + HeaderOutsideLineNumberText + ] + }; + alreadyConverted.push(HeaderOutsideLineNumberColumns); + } else { + currentParagraph = create("text"); + currentParagraph.marginBottom = 4; + currentParagraph.marginTop = 10; + currentParagraph = parseChildren(alreadyConverted, element, currentParagraph, styles.concat(elementStyles[nodeName]), diff_mode); + alreadyConverted.push(currentParagraph); + } + break; case "a": currentParagraph = parseChildren(alreadyConverted, element, currentParagraph, styles.concat(elementStyles[nodeName]), diff_mode); alreadyConverted.push(currentParagraph); From 0036029709d373731593aaab271c8681c14adfde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Tue, 21 Mar 2017 16:05:12 +0100 Subject: [PATCH 2/2] Fixed double paragraphs in motion pdf which contains links (Fixed #3095). --- openslides/core/static/js/core/pdf.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index 5948dbbdd..21c0bb978 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -561,9 +561,6 @@ angular.module('OpenSlidesApp.core.pdf', []) } break; case "a": - currentParagraph = parseChildren(alreadyConverted, element, currentParagraph, styles.concat(elementStyles[nodeName]), diff_mode); - alreadyConverted.push(currentParagraph); - break; case "b": case "strong": case "u":