Allowed ol list types (in html and pdf).

This commit is contained in:
Emanuel Schütze 2020-11-23 15:33:16 +01:00
parent 26e414e3d1
commit ab230fe7a9
2 changed files with 21 additions and 0 deletions

View File

@ -278,6 +278,26 @@ export class HtmlToPdfService {
...this.computeStyle(styles),
...this.computeStyle(this.elementStyles[nodeName])
};
// if the ol list has specific list type
if (nodeName === 'li' && element.parentNode.nodeName === 'OL') {
const type = element.parentElement.getAttribute('type');
switch (type) {
case 'a':
newParagraph.listType = 'lower-alpha';
break;
case 'A':
newParagraph.listType = 'upper-alpha';
break;
case 'i':
newParagraph.listType = 'lower-roman';
break;
case 'I':
newParagraph.listType = 'upper-roman';
break;
default:
break;
}
}
break;
}
case 'a':

View File

@ -74,6 +74,7 @@ allowed_attributes = [
"style",
"target",
"title",
"type",
"width",
]