Merge pull request #5717 from emanuelschuetze/listType
Add ol list type.
This commit is contained in:
commit
65c7d3491c
@ -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':
|
||||
|
@ -74,6 +74,7 @@ allowed_attributes = [
|
||||
"style",
|
||||
"target",
|
||||
"title",
|
||||
"type",
|
||||
"width",
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user