epub presets improves

This commit is contained in:
Kiryl
2022-10-13 11:05:48 +03:00
parent 5a57bf4d32
commit 93979e8d59
2 changed files with 37 additions and 15 deletions

View File

@@ -48,17 +48,23 @@
{
"tags": ["^h[6-9]$", "^figure$", "^section$", "^div$", "blockquote"],
"condition": null,
"tag_to_replace": "p"
"tag_to_replace": {
"name": "p"
}
},
{
"tags": ["^aside$"],
"condition": null,
"tag_to_replace": "div"
"tag_to_replace": {
"name": "div"
}
},
{
"tags": ["^header$", "^footer$"],
"condition": null,
"tag_to_replace": "span"
"tag_to_replace": {
"name": "span"
}
},
{
"tags": ["^code$", "^kbd$", "^var$"],
@@ -67,22 +73,30 @@
"child_tags": null,
"attrs": null
},
"tag_to_replace": "span"
"tag_to_replace": {
"name": "span"
}
},
{
"tags": ["^em$"],
"condition": null,
"tag_to_replace": "i"
"tag_to_replace": {
"name": "i"
}
},
{
"tags": ["^b$"],
"condition": null,
"tag_to_replace": "strong"
"tag_to_replace": {
"name": "strong"
}
},
{
"tags": ["^image$"],
"condition": null,
"tag_to_replace": "img"
"tag_to_replace": {
"name": "img"
}
}
]
},
@@ -90,12 +104,14 @@
"preset_name": "attr_replacer",
"rules": [
{
"attr": {
"name": "xlink:href",
"value": ".*"
},
"tags": ["^img$"],
"condition": {
"tags": ["^img$"]
"attrs": [
{
"name": "xlink:href",
"value": ".*"
}
]
},
"attr_to_replace": {
"name": "src",
@@ -140,12 +156,18 @@
"child_tags": ":not(:has(code, kbd, var))",
"attrs": null
},
"tag_to_insert": "code"
"tag_to_insert": {
"name": "code",
"attrs": []
}
},
{
"tags": ["^h[1-5]$"],
"condition": null,
"tag_to_insert": "strong"
"tag_to_insert": {
"name":"strong",
"attrs": []
}
}
]
}