From ab230fe7a93f116b923c2f3171d4dd9c945a541d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Mon, 23 Nov 2020 15:33:16 +0100 Subject: [PATCH] Allowed ol list types (in html and pdf). --- .../core/pdf-services/html-to-pdf.service.ts | 20 +++++++++++++++++++ server/openslides/utils/validate.py | 1 + 2 files changed, 21 insertions(+) diff --git a/client/src/app/core/pdf-services/html-to-pdf.service.ts b/client/src/app/core/pdf-services/html-to-pdf.service.ts index e62542228..7d90e8269 100644 --- a/client/src/app/core/pdf-services/html-to-pdf.service.ts +++ b/client/src/app/core/pdf-services/html-to-pdf.service.ts @@ -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': diff --git a/server/openslides/utils/validate.py b/server/openslides/utils/validate.py index 1aa61edb6..73122b44c 100644 --- a/server/openslides/utils/validate.py +++ b/server/openslides/utils/validate.py @@ -74,6 +74,7 @@ allowed_attributes = [ "style", "target", "title", + "type", "width", ]