Fix spoiler issue.

This commit is contained in:
noface 2013-08-18 16:56:01 +02:00 committed by Mayhem
parent 202d7617e3
commit 7b842c01be

View File

@ -45,8 +45,9 @@ Linkify =
startNode = node startNode = node
while start.length < link.length while start.length < link.length
start += data = (node = walker.nextNode())?.data start += data = (node = walker.nextNode())?.data
if Conf['Clean Links']
{parentNode} = node {parentNode} = node
if parentNode.nodeName is 'S' and Conf['Clean Links'] if parentNode.nodeName is 'S' and parentNode.textContent.length < link.length
$.replace parentNode, node $.replace parentNode, node
continue unless start[...link.length] is link continue unless start[...link.length] is link
endIndex = link[start.length - data.length...].length endIndex = link[start.length - data.length...].length
@ -88,5 +89,4 @@ Linkify =
range.surroundContents anchor range.surroundContents anchor
if !Conf['Clean Links'] and parentClone and anchor.firstChild if !Conf['Clean Links'] and parentClone and anchor.firstChild
$.replace anchor.firstChild, parentClone $.replace anchor.firstChild, parentClone
catch
endNode endNode