FIX: Apply code quoting with no syntax highlighting (#9784)

This commit is contained in:
Kane York 2020-05-14 13:03:42 -07:00 committed by GitHub
parent 4595560537
commit e0e967ac46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,6 @@ export function selectedText() {
for (let r = 0; r < selection.rangeCount; r++) {
const range = selection.getRangeAt(r);
const $ancestor = $(range.commonAncestorContainer);
const $codeBlockTest = $ancestor.parent("pre");
// ensure we never quote text in the post menu area
const $postMenuArea = $ancestor.find(".post-menu-area")[0];
@ -145,6 +144,7 @@ export function selectedText() {
range.setEndBefore($postMenuArea);
}
const $codeBlockTest = $ancestor.parents("pre");
if ($codeBlockTest.length) {
const $code = $("<code>");
$code.append(range.cloneContents());