fixup: improve quote and code block newline handling
This commit is contained in:
parent
e0668e8517
commit
42c37d8293
1 changed files with 3 additions and 4 deletions
|
@ -59,7 +59,7 @@ export function formatRangeAsQuote(range) {
|
||||||
if (!rangeStartsAtBeginningOfLine(range)) {
|
if (!rangeStartsAtBeginningOfLine(range)) {
|
||||||
parts.unshift(partCreator.newline());
|
parts.unshift(partCreator.newline());
|
||||||
}
|
}
|
||||||
if (rangeEndsAtEndOfLine(range)) {
|
if (!rangeEndsAtEndOfLine(range)) {
|
||||||
parts.push(partCreator.newline());
|
parts.push(partCreator.newline());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,15 +79,14 @@ export function formatRangeAsCode(range) {
|
||||||
parts.push(
|
parts.push(
|
||||||
partCreator.newline(),
|
partCreator.newline(),
|
||||||
partCreator.plain("```"));
|
partCreator.plain("```"));
|
||||||
if (rangeEndsAtEndOfLine(range)) {
|
if (!rangeEndsAtEndOfLine(range)) {
|
||||||
parts.push(partCreator.newline());
|
parts.push(partCreator.newline());
|
||||||
}
|
}
|
||||||
replaceRangeAndExpandSelection(model, range, parts);
|
|
||||||
} else {
|
} else {
|
||||||
parts.unshift(partCreator.plain("`"));
|
parts.unshift(partCreator.plain("`"));
|
||||||
parts.push(partCreator.plain("`"));
|
parts.push(partCreator.plain("`"));
|
||||||
replaceRangeAndExpandSelection(model, range, parts);
|
|
||||||
}
|
}
|
||||||
|
replaceRangeAndExpandSelection(model, range, parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatInline(range, prefix, suffix = prefix) {
|
export function formatInline(range, prefix, suffix = prefix) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue