Clean links from spoiler and code tags.
This commit is contained in:
parent
abfbd734aa
commit
4196ce2600
@ -29,7 +29,7 @@ Config =
|
||||
'Reveal Spoilers': [false, 'Reveal spoiler thumbnails.']
|
||||
'Linkification':
|
||||
'Linkify': [true, 'Convert text links into hyperlinks.']
|
||||
'Clean Links': [true, 'Remove spoiler texts commonly used to bypass banned links.']
|
||||
'Clean Links': [true, 'Remove spoiler and code tags commonly used to bypass blocked links.']
|
||||
'Menu':
|
||||
'Menu': [true, 'Add a drop-down menu to posts.']
|
||||
'Report Link': [true, 'Add a report link to the menu.']
|
||||
|
||||
@ -23,7 +23,7 @@ Linkify =
|
||||
# Replace already-linkified links,
|
||||
# f.e.: https://boards.4chan.org/b/%
|
||||
$.replace parent, anchor
|
||||
Linkify.cleanLink anchor if Conf['Clean Links']
|
||||
Linkify.cleanLink anchor, link if Conf['Clean Links']
|
||||
walker.currentNode = anchor.lastChild
|
||||
else
|
||||
walker.currentNode = boundaries.endNode
|
||||
@ -97,5 +97,8 @@ Linkify =
|
||||
boundaries.endNode = parent
|
||||
boundaries.endOffset = [parent.childNodes...].indexOf(parentNode) + 1
|
||||
|
||||
cleanLink: (anchor) ->
|
||||
# TODO
|
||||
cleanLink: (anchor, link) ->
|
||||
{length} = link
|
||||
for node in $$ 's, .prettyprint', anchor
|
||||
$.replace node, [node.childNodes...] if length > node.textContent.length
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user