mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 22:46:01 +08:00
FIX: Apply code quoting with no syntax highlighting (#9784)
This commit is contained in:
@ -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());
|
||||||
|
Reference in New Issue
Block a user