mirror of
https://github.com/danpros/htmly.git
synced 2026-04-17 19:26:08 +05:30
Update Markdown.Editor.js
Use triple backticks instead of four spaces for <code> block.
This commit is contained in:
parent
6149e42f46
commit
ea2c17473f
1 changed files with 5 additions and 3 deletions
|
|
@ -2049,15 +2049,17 @@
|
|||
chunk.skipLines(nLinesBack, nLinesForward);
|
||||
|
||||
if (!chunk.selection) {
|
||||
chunk.startTag = " ";
|
||||
chunk.startTag = "```\n";
|
||||
chunk.selection = this.getString("codeexample");
|
||||
chunk.endTag = "\n```";
|
||||
}
|
||||
else {
|
||||
if (/^[ ]{0,3}\S/m.test(chunk.selection)) {
|
||||
if (/\n/.test(chunk.selection))
|
||||
chunk.selection = chunk.selection.replace(/^/gm, " ");
|
||||
chunk.selection = "```\n" + chunk.selection;
|
||||
else // if it's not multiline, do not select the four added spaces; this is more consistent with the doList behavior
|
||||
chunk.before += " ";
|
||||
chunk.startTag = "```\n";
|
||||
chunk.endTag = "\n```";
|
||||
}
|
||||
else {
|
||||
chunk.selection = chunk.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm, "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue