From 5b8d11d661822d506d59e013aef924dadf40448e Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Tue, 10 Apr 2018 08:14:42 +0200 Subject: [PATCH] Validize assignment description, if old-style play intext is in the database --- openslides/assignments/static/js/assignments/pdf.js | 6 ++++-- openslides/core/static/js/core/pdf.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openslides/assignments/static/js/assignments/pdf.js b/openslides/assignments/static/js/assignments/pdf.js index c1df67933..26bfb979c 100644 --- a/openslides/assignments/static/js/assignments/pdf.js +++ b/openslides/assignments/static/js/assignments/pdf.js @@ -6,9 +6,10 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) .factory('AssignmentContentProvider', [ '$filter', + 'HTMLValidizer', 'gettextCatalog', 'PDFLayout', - function($filter, gettextCatalog, PDFLayout) { + function($filter, HTMLValidizer, gettextCatalog, PDFLayout) { var createInstance = function(assignment) { @@ -39,6 +40,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) // description var createDescription = function() { if (assignment.description) { + var html = HTMLValidizer.validize(assignment.description); var descriptionText = gettextCatalog.getString("Description") + ":"; var description = [ { @@ -47,7 +49,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) style: 'textItem' }, { - text: $(assignment.description).text(), + text: $(html).text(), style: 'textItem', margin: [10, 0, 0, 0] } diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index 5ce270beb..bd9823b1a 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -144,9 +144,9 @@ angular.module('OpenSlidesApp.core.pdf', []) return str; } }); - return "

" + str + "

"; + return '

' + str + '

'; } else { - return ""; //needed for blank "reasons" field + return ''; //needed for blank "reasons" field } }; return HTMLValidizer;