docx presets improves

This commit is contained in:
Kiryl
2022-10-13 11:05:32 +03:00
parent a08f210d4d
commit 5a57bf4d32
2 changed files with 72 additions and 18 deletions

View File

@@ -12,9 +12,13 @@
"name": "id",
"value": "^Table of Contents\\d+"
}
]
],
"text": null
},
"tag_to_wrap": "TOC"
"tag_to_wrap": {
"name": "TOC",
"attrs": []
}
}
]
},
@@ -35,7 +39,8 @@
"name": "id",
"value": "^Table of Contents\\d+"
}
]
],
"text": null
}
}
]
@@ -46,7 +51,10 @@
{
"tags": ["^h[6-9]$"],
"condition": null,
"tag_to_replace": "p"
"tag_to_replace": {
"name": "p",
"attrs": null
}
},
{
"tags": ["^div$"],
@@ -58,9 +66,13 @@
"name": "style",
"value": "column-count: 2"
}
]
],
"text": null
},
"tag_to_replace": "p"
"tag_to_replace": {
"name": "p",
"attrs": null
}
}
]
},
@@ -68,12 +80,14 @@
"preset_name": "attr_replacer",
"rules": [
{
"attr": {
"name": "style",
"value": "column-count: 2"
},
"tags": ["^p$"],
"condition": {
"tags": ["^p$"]
"attrs": [
{
"name": "style",
"value": "column-count: 2"
}
]
},
"attr_to_replace": {
"name": "class",
@@ -103,7 +117,8 @@
"name": "face",
"value": "^Times New Roman[\\w, ]+$"
}
]
],
"text": null
}
},
{
@@ -111,7 +126,8 @@
"condition": {
"parent_tags": ":is(li)",
"child_tags": null,
"attrs": null
"attrs": null,
"text": null
}
},
{
@@ -124,7 +140,8 @@
"name": "name",
"value": "_GoBack"
}
]
],
"text": null
}
},
{
@@ -132,7 +149,8 @@
"condition": {
"parent_tags": ":is(a)",
"child_tags": ":is(a)",
"attrs": null
"attrs": null,
"text": null
}
},
{
@@ -140,7 +158,8 @@
"condition": {
"parent_tags": ":is(h1, h2, h3, h4, h5, h6, h7, h8, h9)",
"child_tags": null,
"attrs": null
"attrs": null,
"text": null
}
},
{
@@ -148,5 +167,40 @@
"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": "\\\\"
}
]
}
]