mirror of
https://github.com/mayurankv/Obsidian-Code-Styler.git
synced 2026-07-22 08:10:29 +00:00
Fix multiline properly
This commit is contained in:
parent
e2047cc980
commit
7ff1846d5b
2 changed files with 1 additions and 6 deletions
4
main.js
4
main.js
File diff suppressed because one or more lines are too long
|
|
@ -209,7 +209,6 @@ async function remakeCodeblock(codeblockCodeElement: HTMLElement, codeblockPreEl
|
|||
let tree = unified().use(remarkParse).parse(codeblockCodeElement.innerHTML.replace(/\n/g,'<br>'));
|
||||
let stack: Array<string> = [];
|
||||
let codeblockHTML: string = '';
|
||||
let oldCodeblockLines = codeblockCodeElement.innerHTML.split("\n");
|
||||
codeblockCodeElement.innerHTML = "";
|
||||
visit(tree,(node)=>{
|
||||
if (node.type === 'html' || node.type === 'text') {
|
||||
|
|
@ -224,8 +223,6 @@ async function remakeCodeblock(codeblockCodeElement: HTMLElement, codeblockPreEl
|
|||
}
|
||||
});
|
||||
let codeblockLines = codeblockHTML.split('<br>');
|
||||
console.log(codeblockLines.length,oldCodeblockLines.length)
|
||||
// codeblockLines
|
||||
if (codeblockLines.length == 1)
|
||||
codeblockLines = ['',''];
|
||||
codeblockLines.forEach((line,index) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue