forked from LiveCarta/BookConverter
Change presets.json (add attr_replacer)
This commit is contained in:
@@ -2,94 +2,112 @@
|
||||
{
|
||||
"preset_name": "table_wrapper",
|
||||
"rules": [
|
||||
{
|
||||
"tags": ["div"],
|
||||
"attrs": [
|
||||
{
|
||||
"name": "width",
|
||||
"value": ".*"
|
||||
},
|
||||
{
|
||||
"name": "border",
|
||||
"value": ".*"
|
||||
},
|
||||
{
|
||||
"name": "bgcolor",
|
||||
"value": ".*"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": ["section", "blockquote"],
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"value": "feature[1234]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
{
|
||||
"tags": ["div"],
|
||||
"attrs": [
|
||||
{
|
||||
"name": "width",
|
||||
"value": ".*"
|
||||
},
|
||||
{
|
||||
"name": "border",
|
||||
"value": ".*"
|
||||
},
|
||||
{
|
||||
"name": "bgcolor",
|
||||
"value": ".*"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tags": ["section", "blockquote"],
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"value": "feature[1234]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"preset_name": "replacer",
|
||||
"rules": [
|
||||
{
|
||||
"tags": ["^h[6-9]$", "^figure$", "^section$", "^div$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "p"
|
||||
},
|
||||
{
|
||||
"tags": ["^aside$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "blockquote"
|
||||
},
|
||||
{
|
||||
"tags": ["^header$", "^footer$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "span"
|
||||
},
|
||||
{
|
||||
"tags": ["^code$", "^kbd$", "^var$"],
|
||||
"condition": {
|
||||
"parent_tags": ":not(pre)",
|
||||
"child_tags": null,
|
||||
"attrs": null
|
||||
{
|
||||
"tags": ["^h[6-9]$", "^figure$", "^section$", "^div$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "p"
|
||||
},
|
||||
"tag_to_replace": "span"
|
||||
},
|
||||
{
|
||||
"tags": ["^b$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "strong"
|
||||
}
|
||||
]
|
||||
{
|
||||
"tags": ["^aside$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "blockquote"
|
||||
},
|
||||
{
|
||||
"tags": ["^header$", "^footer$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "span"
|
||||
},
|
||||
{
|
||||
"tags": ["^code$", "^kbd$", "^var$"],
|
||||
"condition": {
|
||||
"parent_tags": ":not(pre)",
|
||||
"child_tags": null,
|
||||
"attrs": null
|
||||
},
|
||||
"tag_to_replace": "span"
|
||||
},
|
||||
{
|
||||
"tags": ["^b$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "strong"
|
||||
},
|
||||
{
|
||||
"tags": ["^image$"],
|
||||
"condition": null,
|
||||
"tag_to_replace": "img"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"preset_name": "attr_replacer",
|
||||
"rules": [
|
||||
{
|
||||
"attr": "xlink:href",
|
||||
"condition": {
|
||||
"tags": ["img"]
|
||||
},
|
||||
"attr_to_replace": "src"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"preset_name": "unwrapper",
|
||||
"rules": {
|
||||
"tags": [
|
||||
"section",
|
||||
"article",
|
||||
"figcaption",
|
||||
"main",
|
||||
"body",
|
||||
"html",
|
||||
"li > p"
|
||||
"section",
|
||||
"article",
|
||||
"figcaption",
|
||||
"main",
|
||||
"body",
|
||||
"html",
|
||||
"svg",
|
||||
"li > p"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"preset_name": "inserter",
|
||||
"rules": [
|
||||
{
|
||||
"tags": ["pre"],
|
||||
"condition": {
|
||||
"parent_tags": null,
|
||||
"child_tags": ":not(code, kbd, var)",
|
||||
"attrs": null
|
||||
},
|
||||
"tag_to_insert": "code"
|
||||
}
|
||||
{
|
||||
"tags": ["pre"],
|
||||
"condition": {
|
||||
"parent_tags": null,
|
||||
"child_tags": ":not(code, kbd, var)",
|
||||
"attrs": null
|
||||
},
|
||||
"tag_to_insert": "code"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user