Merge pull request #5717 from emanuelschuetze/listType

Add ol list type.
This commit is contained in:
Sean 2020-11-25 11:23:50 +01:00 committed by GitHub
commit 65c7d3491c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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",
]