Validize assignment description, if old-style play intext is in the database

This commit is contained in:
FinnStutzenstein 2018-04-10 08:14:42 +02:00
parent ba579637bd
commit 5b8d11d661
2 changed files with 6 additions and 4 deletions

View File

@ -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]
}

View File

@ -144,9 +144,9 @@ angular.module('OpenSlidesApp.core.pdf', [])
return str;
}
});
return "<p>" + str + "</p>";
return '<p>' + str + '</p>';
} else {
return ""; //needed for blank "reasons" field
return ''; //needed for blank "reasons" field
}
};
return HTMLValidizer;