FIX: clicking on heading could insert a broken heading

This commit is contained in:
Sam 2014-10-03 16:34:26 +10:00
parent b525d95d19
commit 8c214c35e4
1 changed files with 10 additions and 0 deletions

View File

@ -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;
}