Merge pull request #3688 from FinnStutzenstein/validateAssignmentDescription
Validize assignment description, if old-style play intext is in the d…
This commit is contained in:
commit
15403e9ba3
@ -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]
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user