FIX: Apply code quoting with no syntax highlighting (#9784)
This commit is contained in:
parent
4595560537
commit
e0e967ac46
|
@ -137,7 +137,6 @@ export function selectedText() {
|
||||||
for (let r = 0; r < selection.rangeCount; r++) {
|
for (let r = 0; r < selection.rangeCount; r++) {
|
||||||
const range = selection.getRangeAt(r);
|
const range = selection.getRangeAt(r);
|
||||||
const $ancestor = $(range.commonAncestorContainer);
|
const $ancestor = $(range.commonAncestorContainer);
|
||||||
const $codeBlockTest = $ancestor.parent("pre");
|
|
||||||
|
|
||||||
// ensure we never quote text in the post menu area
|
// ensure we never quote text in the post menu area
|
||||||
const $postMenuArea = $ancestor.find(".post-menu-area")[0];
|
const $postMenuArea = $ancestor.find(".post-menu-area")[0];
|
||||||
|
@ -145,6 +144,7 @@ export function selectedText() {
|
||||||
range.setEndBefore($postMenuArea);
|
range.setEndBefore($postMenuArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const $codeBlockTest = $ancestor.parents("pre");
|
||||||
if ($codeBlockTest.length) {
|
if ($codeBlockTest.length) {
|
||||||
const $code = $("<code>");
|
const $code = $("<code>");
|
||||||
$code.append(range.cloneContents());
|
$code.append(range.cloneContents());
|
||||||
|
|
Loading…
Reference in New Issue