Allowed ol list types (in html and pdf).
This commit is contained in:
parent
26e414e3d1
commit
ab230fe7a9
@ -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