feat: 完善导出设置与打印预览
This commit is contained in:
@@ -78,6 +78,7 @@ const markdown = new MarkdownIt(markdownOptions)
|
||||
|
||||
const defaultFenceRenderer = markdown.renderer.rules.fence;
|
||||
const lengthStylePattern = /^-?\d+(?:\.\d+)?(?:em|ex|px|%)$/u;
|
||||
const tableTextAlignStylePattern = /^(?:left|center|right)$/u;
|
||||
|
||||
markdown.renderer.rules.fence = (
|
||||
tokens,
|
||||
@@ -131,8 +132,8 @@ const safeHtmlOptions: sanitizeHtml.IOptions = {
|
||||
li: ["class", "value"],
|
||||
ol: ["class", "start"],
|
||||
span: ["class", "style"],
|
||||
td: ["colspan", "rowspan"],
|
||||
th: ["colspan", "rowspan", "scope"]
|
||||
td: ["colspan", "rowspan", "style"],
|
||||
th: ["colspan", "rowspan", "scope", "style"]
|
||||
},
|
||||
allowedSchemes: ["http", "https", "mailto"],
|
||||
allowedSchemesByTag: {
|
||||
@@ -149,6 +150,12 @@ const safeHtmlOptions: sanitizeHtml.IOptions = {
|
||||
"padding-left": [lengthStylePattern],
|
||||
"vertical-align": [lengthStylePattern],
|
||||
"border-bottom-width": [lengthStylePattern]
|
||||
},
|
||||
td: {
|
||||
"text-align": [tableTextAlignStylePattern]
|
||||
},
|
||||
th: {
|
||||
"text-align": [tableTextAlignStylePattern]
|
||||
}
|
||||
},
|
||||
transformTags: {
|
||||
|
||||
Reference in New Issue
Block a user