📝 使用 HTML 块时建议使用 div 包裹代码 HTML 块中包含多个 <pre> 时只能保存第一个

This commit is contained in:
Liang Ding 2022-08-28 10:27:19 +08:00
parent 5204d8e74c
commit ca80141164
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 275 additions and 14 deletions

View file

@ -6,7 +6,7 @@
"title": "Formatting elements",
"title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;",
"type": "doc",
"updated": "20220820214308"
"updated": "20220828102624"
},
"Children": [
{
@ -2746,10 +2746,10 @@
{
"ID": "20220312004751-frosojs",
"Type": "NodeHTMLBlock",
"Data": "\u003cruby\u003e\n你\u003crt\u003enǐ\u003c/rt\u003e\n 好\u003crt\u003e hǎo\u003c/rt\u003e\n 世\u003crt\u003e shì\u003c/rt\u003e\n 界\u003crt\u003e jiè\u003c/rt\u003e\n\u003c/ruby\u003e\u003cbr\u003e\nHello World",
"Data": "\u003cdiv\u003e\n\u003cruby\u003e\n你\u003crt\u003enǐ\u003c/rt\u003e\n 好\u003crt\u003e hǎo\u003c/rt\u003e\n 世\u003crt\u003e shì\u003c/rt\u003e\n 界\u003crt\u003e jiè\u003c/rt\u003e\n\u003c/ruby\u003e\u003cbr\u003e\nHello World\n\u003c/div\u003e",
"Properties": {
"id": "20220312004751-frosojs",
"updated": "20220312122043"
"updated": "20220828102624"
}
},
{
@ -2757,7 +2757,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20220312122714-jgaetrv",
"updated": "20220312122717"
"updated": "20220828102557"
},
"Children": [
{
@ -2778,7 +2778,94 @@
},
{
"Type": "NodeText",
"Data": ": The code in the HTML block will not be safely filtered when using it. Please confirm the code is safe before using it to avoid cross-site scripting (XSS)."
"Data": ": "
}
]
},
{
"ID": "20220828102558-h9c9bwe",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220828102558-h9c9bwe",
"updated": "20220828102558"
},
"Children": [
{
"ID": "20220828102558-8ibvw54",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220828102558-8ibvw54",
"updated": "20220828102558"
},
"Children": [
{
"ID": "20220828102558-zt2eu0w",
"Type": "NodeParagraph",
"Properties": {
"id": "20220828102558-zt2eu0w",
"updated": "20220828102558"
},
"Children": [
{
"Type": "NodeText",
"Data": "When using the HTML block, the code in it will not be security filtered, please confirm the code is safe before using it to avoid cross-site scripting attack (XSS)"
}
]
}
]
},
{
"ID": "20220828102558-r1v2xmr",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220828102558-r1v2xmr",
"updated": "20220828102558"
},
"Children": [
{
"ID": "20220828102558-1cg51k8",
"Type": "NodeParagraph",
"Properties": {
"id": "20220828102558-1cg51k8",
"updated": "20220828102558"
},
"Children": [
{
"Type": "NodeText",
"Data": "Because the Markdown specification is more complicated for HTML block parsing rules, it is recommended to use "
},
{
"Type": "NodeCodeSpan",
"Data": "code",
"Children": [
{
"Type": "NodeCodeSpanOpenMarker"
},
{
"Type": "NodeCodeSpanContent",
"Data": "\u003cdiv\u003e\u003c/div\u003e"
},
{
"Type": "NodeCodeSpanCloseMarker"
}
]
},
{
"Type": "NodeText",
"Data": " to wrap HTML code and remove blank lines"
}
]
}
]
}
]
},

View file

@ -6,7 +6,7 @@
"title": "排版元素",
"title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);",
"type": "doc",
"updated": "20220820214105"
"updated": "20220828102447"
},
"Children": [
{
@ -2714,10 +2714,10 @@
{
"ID": "20220312004517-f6i1k8m",
"Type": "NodeHTMLBlock",
"Data": "\u003cruby\u003e\n你\u003crt\u003enǐ\u003c/rt\u003e\n 好\u003crt\u003e hǎo\u003c/rt\u003e\n 世\u003crt\u003e shì\u003c/rt\u003e\n 界\u003crt\u003e jiè\u003c/rt\u003e\n\u003c/ruby\u003e\u003cbr\u003e\nHello World",
"Data": "\u003cdiv\u003e\n\u003cruby\u003e\n你\u003crt\u003enǐ\u003c/rt\u003e\n 好\u003crt\u003e hǎo\u003c/rt\u003e\n 世\u003crt\u003e shì\u003c/rt\u003e\n 界\u003crt\u003e jiè\u003c/rt\u003e\n\u003c/ruby\u003e\u003cbr\u003e\nHello World\n\u003c/div\u003e",
"Properties": {
"id": "20220312004517-f6i1k8m",
"updated": "20220312122020"
"updated": "20220828102447"
}
},
{
@ -2746,7 +2746,94 @@
},
{
"Type": "NodeText",
"Data": ":使用 HTML 块时不会对其中的代码进行安全过滤请确认代码安全后再使用以免遭遇跨站脚本攻击XSS。"
"Data": ""
}
]
},
{
"ID": "20220828102305-kv9o4nz",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220828102305-kv9o4nz",
"updated": "20220828102421"
},
"Children": [
{
"ID": "20220828102306-gt8j7lc",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220828102306-gt8j7lc",
"updated": "20220828102306"
},
"Children": [
{
"ID": "20220828102306-4yswrhi",
"Type": "NodeParagraph",
"Properties": {
"id": "20220828102306-4yswrhi",
"updated": "20220828102306"
},
"Children": [
{
"Type": "NodeText",
"Data": "使用 HTML 块时不会对其中的代码进行安全过滤请确认代码安全后再使用以免遭遇跨站脚本攻击XSS"
}
]
}
]
},
{
"ID": "20220828102307-hhuecb8",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220828102307-hhuecb8",
"updated": "20220828102421"
},
"Children": [
{
"ID": "20220828102307-t8ssvfi",
"Type": "NodeParagraph",
"Properties": {
"id": "20220828102307-t8ssvfi",
"updated": "20220828102421"
},
"Children": [
{
"Type": "NodeText",
"Data": "因为 Markdown 规范对 HTML 块解析规则较为复杂,建议使用 "
},
{
"Type": "NodeCodeSpan",
"Data": "code",
"Children": [
{
"Type": "NodeCodeSpanOpenMarker"
},
{
"Type": "NodeCodeSpanContent",
"Data": "\u003cdiv\u003e\u003c/div\u003e"
},
{
"Type": "NodeCodeSpanCloseMarker"
}
]
},
{
"Type": "NodeText",
"Data": " 包裹 HTML 代码并去掉空行"
}
]
}
]
}
]
},

View file

@ -5,7 +5,7 @@
"id": "20211226121319-emrk2yy",
"title": "排版元素",
"title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);",
"updated": "20220820214459"
"updated": "20220828102621"
},
"Children": [
{
@ -2718,10 +2718,10 @@
{
"ID": "20220312004730-udc38az",
"Type": "NodeHTMLBlock",
"Data": "\u003cruby\u003e\n你\u003crt\u003enǐ\u003c/rt\u003e\n 好\u003crt\u003e hǎo\u003c/rt\u003e\n 世\u003crt\u003e shì\u003c/rt\u003e\n 界\u003crt\u003e jiè\u003c/rt\u003e\n\u003c/ruby\u003e\u003cbr\u003e\nHello World",
"Data": "\u003cdiv\u003e\n\u003cruby\u003e\n你\u003crt\u003enǐ\u003c/rt\u003e\n 好\u003crt\u003e hǎo\u003c/rt\u003e\n 世\u003crt\u003e shì\u003c/rt\u003e\n 界\u003crt\u003e jiè\u003c/rt\u003e\n\u003c/ruby\u003e\u003cbr\u003e\nHello World\n\u003c/div\u003e",
"Properties": {
"id": "20220312004730-udc38az",
"updated": "20220312122027"
"updated": "20220828102621"
}
},
{
@ -2729,7 +2729,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20220312122707-8258e11",
"updated": "20220312122802"
"updated": "20220828102532"
},
"Children": [
{
@ -2750,7 +2750,94 @@
},
{
"Type": "NodeText",
"Data": ":使用 HTML 塊時不會對其中的代碼進行安全過濾請確認代碼安全後再使用以免遭遇跨站腳本攻擊XSS。"
"Data": ""
}
]
},
{
"ID": "20220828102532-4j8tblh",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20220828102532-4j8tblh",
"updated": "20220828102532"
},
"Children": [
{
"ID": "20220828102532-69g744z",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220828102532-69g744z",
"updated": "20220828102532"
},
"Children": [
{
"ID": "20220828102532-ozh8pha",
"Type": "NodeParagraph",
"Properties": {
"id": "20220828102532-ozh8pha",
"updated": "20220828102532"
},
"Children": [
{
"Type": "NodeText",
"Data": "使用 HTML 塊時不會對其中的代碼進行安全過濾請確認代碼安全後再使用以免遭遇跨站腳本攻擊XSS"
}
]
}
]
},
{
"ID": "20220828102532-xrle9qv",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20220828102532-xrle9qv",
"updated": "20220828102532"
},
"Children": [
{
"ID": "20220828102532-u9zdtto",
"Type": "NodeParagraph",
"Properties": {
"id": "20220828102532-u9zdtto",
"updated": "20220828102532"
},
"Children": [
{
"Type": "NodeText",
"Data": "因為 Markdown 規範對 HTML 塊解析規則較為複雜,建議使用 "
},
{
"Type": "NodeCodeSpan",
"Data": "code",
"Children": [
{
"Type": "NodeCodeSpanOpenMarker"
},
{
"Type": "NodeCodeSpanContent",
"Data": "\u003cdiv\u003e\u003c/div\u003e"
},
{
"Type": "NodeCodeSpanCloseMarker"
}
]
},
{
"Type": "NodeText",
"Data": " 包裹 HTML 代碼並去掉空行"
}
]
}
]
}
]
},