FIX: clicking on heading could insert a broken heading
This commit is contained in:
parent
b525d95d19
commit
8c214c35e4
|
@ -2241,8 +2241,18 @@
|
|||
// make a level 2 hash header around some default text.
|
||||
if (!chunk.selection) {
|
||||
chunk.startTag = "## ";
|
||||
|
||||
if(chunk.before === "" || !chunk.before.match(/\n$/)){
|
||||
chunk.startTag = "\n## ";
|
||||
}
|
||||
|
||||
chunk.selection = this.getString("headingexample");
|
||||
chunk.endTag = " ##";
|
||||
|
||||
if(chunk.after === "" || !chunk.after.match(/^\n/)){
|
||||
chunk.endTag = "## \n";
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue