mirror of
https://github.com/kotaindah55/extended-markdown-syntax.git
synced 2026-07-22 05:38:06 +00:00
fix: non-tidier format acts like the tidier one
This was fixed by not using wrap() to wrap with delimiters.
This commit is contained in:
parent
25771e6600
commit
cbff48de5a
1 changed files with 6 additions and 2 deletions
|
|
@ -234,8 +234,9 @@ export class Formatter {
|
|||
this.state.pushChange({ from: curRange.to, insert: delimStr });
|
||||
}
|
||||
}
|
||||
/** Run only when tidier formatting is switched off. */
|
||||
toggleDelim() {
|
||||
let { curRange, delimStr } = this.state,
|
||||
let { curRange, delimStr, tagStr } = this.state,
|
||||
delimLen = delimStr.length,
|
||||
selectedStrWithOverlappedEdge = this.doc.sliceString(curRange.from - delimLen, curRange.to + delimLen),
|
||||
selectedStr = selectedStrWithOverlappedEdge.slice(delimLen, -delimLen);
|
||||
|
|
@ -250,7 +251,10 @@ export class Formatter {
|
|||
{ from: curRange.to, to: curRange.to + delimLen }
|
||||
]);
|
||||
} else {
|
||||
this.wrap();
|
||||
this.state.pushChange([
|
||||
{ from: curRange.from, insert: delimStr + (tagStr ?? "") },
|
||||
{ from: curRange.to, insert: delimStr }
|
||||
]);
|
||||
}
|
||||
}
|
||||
addBlockTag(block: { start: number, end: number }) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue