Fix quoting inside of spoiler/code tag when common ancestor is not text node.
This commit is contained in:
parent
7b348a00c6
commit
ac4083b9f4
@ -220,14 +220,13 @@ QR =
|
|||||||
range = sel.getRangeAt 0
|
range = sel.getRangeAt 0
|
||||||
frag = range.cloneContents()
|
frag = range.cloneContents()
|
||||||
ancestor = range.commonAncestorContainer
|
ancestor = range.commonAncestorContainer
|
||||||
if ancestor.nodeName is '#text'
|
# Quoting the insides of a spoiler/code tag.
|
||||||
# Quoting the insides of a spoiler/code tag.
|
if $.x 'ancestor-or-self::s', ancestor
|
||||||
if $.x 'ancestor::s', ancestor
|
$.prepend frag, $.tn '[spoiler]'
|
||||||
$.prepend frag, $.tn '[spoiler]'
|
$.add frag, $.tn '[/spoiler]'
|
||||||
$.add frag, $.tn '[/spoiler]'
|
if $.x 'ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor
|
||||||
if $.x 'ancestor::pre[contains(@class,"prettyprint")]', ancestor
|
$.prepend frag, $.tn '[code]'
|
||||||
$.prepend frag, $.tn '[code]'
|
$.add frag, $.tn '[/code]'
|
||||||
$.add frag, $.tn '[/code]'
|
|
||||||
for node in $$ 'br', frag
|
for node in $$ 'br', frag
|
||||||
$.replace node, $.tn '\n>' unless node is frag.lastChild
|
$.replace node, $.tn '\n>' unless node is frag.lastChild
|
||||||
for node in $$ 's', frag
|
for node in $$ 's', frag
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user