feat(html): Support formatting tags in HTML texts (#2111)

* add parsing for formatting tags in HTML backend

Signed-off-by: Roman Kayan BAZG <roman.kayan@bazg.admin.ch>

fix latest tests + wiki_duck result files.

Signed-off-by: Roman Kayan BAZG <roman.kayan@bazg.admin.ch>

* convert _collect_parent_format_tags to staticmethod

Signed-off-by: Roman Kayan BAZG <roman.kayan@bazg.admin.ch>

---------

Signed-off-by: Roman Kayan BAZG <roman.kayan@bazg.admin.ch>
This commit is contained in:
krrome
2025-08-22 10:37:34 +02:00
committed by GitHub
parent e76298c40d
commit 94fcc46aa9
15 changed files with 9420 additions and 4456 deletions

View File

@@ -39,7 +39,7 @@
"$ref": "#/groups/0"
},
{
"$ref": "#/texts/8"
"$ref": "#/groups/1"
}
],
"content_layer": "body",
@@ -63,6 +63,26 @@
"content_layer": "body",
"name": "details",
"label": "section"
},
{
"self_ref": "#/groups/1",
"parent": {
"$ref": "#/body"
},
"children": [
{
"$ref": "#/texts/8"
},
{
"$ref": "#/texts/9"
},
{
"$ref": "#/texts/10"
}
],
"content_layer": "body",
"name": "group",
"label": "inline"
}
],
"texts": [
@@ -165,14 +185,45 @@
{
"self_ref": "#/texts/8",
"parent": {
"$ref": "#/body"
"$ref": "#/groups/1"
},
"children": [],
"content_layer": "body",
"label": "text",
"prov": [],
"orig": "This is a fourth div with a bold paragraph.",
"text": "This is a fourth div with a bold paragraph."
"orig": "This is a fourth div with a",
"text": "This is a fourth div with a"
},
{
"self_ref": "#/texts/9",
"parent": {
"$ref": "#/groups/1"
},
"children": [],
"content_layer": "body",
"label": "text",
"prov": [],
"orig": "bold",
"text": "bold",
"formatting": {
"bold": true,
"italic": false,
"underline": false,
"strikethrough": false,
"script": "baseline"
}
},
{
"self_ref": "#/texts/10",
"parent": {
"$ref": "#/groups/1"
},
"children": [],
"content_layer": "body",
"label": "text",
"prov": [],
"orig": "paragraph.",
"text": "paragraph."
}
],
"pictures": [],