mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 04:25:40 +08:00
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.
|
// make a level 2 hash header around some default text.
|
||||||
if (!chunk.selection) {
|
if (!chunk.selection) {
|
||||||
chunk.startTag = "## ";
|
chunk.startTag = "## ";
|
||||||
|
|
||||||
|
if(chunk.before === "" || !chunk.before.match(/\n$/)){
|
||||||
|
chunk.startTag = "\n## ";
|
||||||
|
}
|
||||||
|
|
||||||
chunk.selection = this.getString("headingexample");
|
chunk.selection = this.getString("headingexample");
|
||||||
chunk.endTag = " ##";
|
chunk.endTag = " ##";
|
||||||
|
|
||||||
|
if(chunk.after === "" || !chunk.after.match(/^\n/)){
|
||||||
|
chunk.endTag = "## \n";
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user