mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
🎨 Improve code block parsing https://github.com/siyuan-note/siyuan/issues/13831
This commit is contained in:
parent
58d1fe9de6
commit
51d3c737fb
1 changed files with 1 additions and 1 deletions
|
|
@ -151,7 +151,7 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:
|
|||
if (trimStartText.indexOf("\n") === -1 && trimStartText.replace(/·|~/g, "`").replace(/^`{3,}/g, "").indexOf("`") > -1) {
|
||||
// ```test` 不处理,正常渲染为段落块
|
||||
} else {
|
||||
let replaceInnerHTML = editElement.innerHTML.replace(/^(~|·|`){3,}/g, "```").replace(/\n(~|·|`){3,}/g, "\n```").trim();
|
||||
let replaceInnerHTML = editElement.innerHTML.trim().replace(/^(~|·|`){3,}/g, "```").replace(/\n(~|·|`){3,}/g, "\n```").trim();
|
||||
if (!replaceInnerHTML.endsWith("\n```")) {
|
||||
replaceInnerHTML = replaceInnerHTML.replace("<wbr>", "") + "<wbr>\n```";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue