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(styles),
|
||||||
...this.computeStyle(this.elementStyles[nodeName])
|
...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;
|
break;
|
||||||
}
|
}
|
||||||
case 'a':
|
case 'a':
|
||||||
|
@ -74,6 +74,7 @@ allowed_attributes = [
|
|||||||
"style",
|
"style",
|
||||||
"target",
|
"target",
|
||||||
"title",
|
"title",
|
||||||
|
"type",
|
||||||
"width",
|
"width",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user