forked from LiveCarta/BookConverter
207 lines
5.8 KiB
JSON
207 lines
5.8 KiB
JSON
[
|
|
{
|
|
"preset_name": "wrapper",
|
|
"rules": [
|
|
{
|
|
"tags": ["^div$"],
|
|
"condition": {
|
|
"parent_tags": null,
|
|
"child_tags": null,
|
|
"attrs": [
|
|
{
|
|
"name": "id",
|
|
"value": "^Table of Contents\\d+"
|
|
}
|
|
],
|
|
"text": null
|
|
},
|
|
"tag_to_wrap": {
|
|
"name": "TOC",
|
|
"attrs": []
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"preset_name": "decomposer",
|
|
"rules": [
|
|
{
|
|
"tags": ["^div$"],
|
|
"condition": {
|
|
"parent_tags": null,
|
|
"child_tags": null,
|
|
"attrs": [
|
|
{
|
|
"name": "title",
|
|
"value": "footer"
|
|
},
|
|
{
|
|
"name": "id",
|
|
"value": "^Table of Contents\\d+"
|
|
}
|
|
],
|
|
"text": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"preset_name": "replacer",
|
|
"rules": [
|
|
{
|
|
"tags": ["^h[6-9]$"],
|
|
"condition": null,
|
|
"tag_to_replace": {
|
|
"name": "p",
|
|
"attrs": null
|
|
}
|
|
},
|
|
{
|
|
"tags": ["^div$"],
|
|
"condition": {
|
|
"parent_tags": null,
|
|
"child_tags": null,
|
|
"attrs": [
|
|
{
|
|
"name": "style",
|
|
"value": "column-count: 2"
|
|
}
|
|
],
|
|
"text": null
|
|
},
|
|
"tag_to_replace": {
|
|
"name": "p",
|
|
"attrs": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"preset_name": "attr_replacer",
|
|
"rules": [
|
|
{
|
|
"tags": ["^p$"],
|
|
"condition": {
|
|
"attrs": [
|
|
{
|
|
"name": "style",
|
|
"value": "column-count: 2"
|
|
}
|
|
]
|
|
},
|
|
"attr_to_replace": {
|
|
"name": "class",
|
|
"value": "columns2"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"preset_name": "unwrapper",
|
|
"rules": [
|
|
{
|
|
"tags": ["^span$"],
|
|
"condition": {
|
|
"parent_tags": ":is(h1, h2, h3, h4, h5, h6, h7, h8, h9)",
|
|
"child_tags": null,
|
|
"attrs": [
|
|
{
|
|
"name": "style",
|
|
"value": "(^background: #[\\da-fA-F]{6}$)|(^letter-spacing: -?[\\d.]+pt$)"
|
|
},
|
|
{
|
|
"name": "lang",
|
|
"value": "^ru-RU$"
|
|
},
|
|
{
|
|
"name": "face",
|
|
"value": "^Times New Roman[\\w, ]+$"
|
|
}
|
|
],
|
|
"text": null
|
|
}
|
|
},
|
|
{
|
|
"tags": ["^p$"],
|
|
"condition": {
|
|
"parent_tags": ":is(li)",
|
|
"child_tags": null,
|
|
"attrs": null,
|
|
"text": null
|
|
}
|
|
},
|
|
{
|
|
"tags": ["^a$"],
|
|
"condition": {
|
|
"parent_tags": null,
|
|
"child_tags": null,
|
|
"attrs": [
|
|
{
|
|
"name": "name",
|
|
"value": "_GoBack"
|
|
}
|
|
],
|
|
"text": null
|
|
}
|
|
},
|
|
{
|
|
"tags": ["^u$"],
|
|
"condition": {
|
|
"parent_tags": ":is(a)",
|
|
"child_tags": ":is(a)",
|
|
"attrs": null,
|
|
"text": null
|
|
}
|
|
},
|
|
{
|
|
"tags": ["^b$"],
|
|
"condition": {
|
|
"parent_tags": ":is(h1, h2, h3, h4, h5, h6, h7, h8, h9)",
|
|
"child_tags": null,
|
|
"attrs": null,
|
|
"text": null
|
|
}
|
|
},
|
|
{
|
|
"tags": ["^div$"],
|
|
"condition": null
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"preset_name": "inserter",
|
|
"rules": [
|
|
{
|
|
"tags": ["^p$"],
|
|
"condition": {
|
|
"parent_tags": null,
|
|
"child_tags": null,
|
|
"attrs": null,
|
|
"text": "\\$\\$[\\s\\S]*?\\$\\$"
|
|
},
|
|
"tag_to_insert": {
|
|
"name": "span",
|
|
"attrs": [
|
|
{
|
|
"name": "class",
|
|
"value": "math-tex"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"preset_name": "text_replacer",
|
|
"rules": [
|
|
{
|
|
"tags": ["^p$"],
|
|
"condition": {
|
|
"text": "(\\\\nonumber\\\\\\\\\\\\noalign{\\\\pagebreak}[\\s\\S]*?)\\\\"
|
|
},
|
|
"text_to_replace": "\\\\"
|
|
}
|
|
]
|
|
}
|
|
]
|