mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-05 09:04:28 -06:00
Merge pull request #492 from vanillajonathan/patch-1
This commit is contained in:
commit
c27f5d1d23
@ -1143,30 +1143,12 @@ function _toggleHeading(cm, direction, size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (size == 1) {
|
if (currHeadingLevel <= 0) {
|
||||||
if (currHeadingLevel <= 0) {
|
text = '#'.repeat(size) + ' ' + text;
|
||||||
text = '# ' + text;
|
} else if (currHeadingLevel == size) {
|
||||||
} else if (currHeadingLevel == size) {
|
text = text.substr(currHeadingLevel + 1);
|
||||||
text = text.substr(currHeadingLevel + 1);
|
|
||||||
} else {
|
|
||||||
text = '# ' + text.substr(currHeadingLevel + 1);
|
|
||||||
}
|
|
||||||
} else if (size == 2) {
|
|
||||||
if (currHeadingLevel <= 0) {
|
|
||||||
text = '## ' + text;
|
|
||||||
} else if (currHeadingLevel == size) {
|
|
||||||
text = text.substr(currHeadingLevel + 1);
|
|
||||||
} else {
|
|
||||||
text = '## ' + text.substr(currHeadingLevel + 1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (currHeadingLevel <= 0) {
|
text = '#'.repeat(size) + ' ' + text.substr(currHeadingLevel + 1);
|
||||||
text = '### ' + text;
|
|
||||||
} else if (currHeadingLevel == size) {
|
|
||||||
text = text.substr(currHeadingLevel + 1);
|
|
||||||
} else {
|
|
||||||
text = '### ' + text.substr(currHeadingLevel + 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user