sourround -> surround
This commit is contained in:
parent
7b842c01be
commit
58531319ca
@ -27,7 +27,7 @@ Linkify =
|
|||||||
return unless link = links.shift()
|
return unless link = links.shift()
|
||||||
[anchor, link] = Linkify.parseLink link
|
[anchor, link] = Linkify.parseLink link
|
||||||
if data.length >= link.length and (index = data.indexOf link) >= 0
|
if data.length >= link.length and (index = data.indexOf link) >= 0
|
||||||
walker.currentNode = Linkify.sourround anchor, link, index, index + link.length, node
|
walker.currentNode = Linkify.surround anchor, link, index, index + link.length, node
|
||||||
anchor = false
|
anchor = false
|
||||||
continue
|
continue
|
||||||
index = found = 0
|
index = found = 0
|
||||||
@ -51,7 +51,7 @@ Linkify =
|
|||||||
$.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
|
||||||
walker.currentNode = Linkify.sourround anchor, link, index, endIndex, startNode, node
|
walker.currentNode = Linkify.surround anchor, link, index, endIndex, startNode, node
|
||||||
anchor = false
|
anchor = false
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ Linkify =
|
|||||||
rel: 'noreferrer'
|
rel: 'noreferrer'
|
||||||
[anchor, link]
|
[anchor, link]
|
||||||
|
|
||||||
sourround: (anchor, link, startIndex, endIndex, startNode, endNode = startNode) ->
|
surround: (anchor, link, startIndex, endIndex, startNode, endNode = startNode) ->
|
||||||
parent = startNode.parentNode
|
parent = startNode.parentNode
|
||||||
if parent?.nodeName is 'S' and parent.textContent.length < link.length
|
if parent?.nodeName is 'S' and parent.textContent.length < link.length
|
||||||
parentClone = parent.cloneNode true
|
parentClone = parent.cloneNode true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user