Fix activitypub link href checker to ignore no-url
This commit is contained in:
parent
ca3bfbadcb
commit
f2e0d5b634
1 changed files with 5 additions and 2 deletions
|
@ -54,11 +54,14 @@ class Sanitize
|
|||
return unless env[:node_name] == 'a'
|
||||
|
||||
current_node = env[:node]
|
||||
href = current_node['href']
|
||||
href = current_node['href'] || ''
|
||||
text = current_node.text
|
||||
cls = current_node['class'] || ''
|
||||
|
||||
scheme = if current_node['href'] =~ Sanitize::REGEX_PROTOCOL
|
||||
dot_pos = text.index('.')
|
||||
return unless dot_pos.present? && dot_pos > 0 && dot_pos < text.size - 1
|
||||
|
||||
scheme = if href =~ Sanitize::REGEX_PROTOCOL
|
||||
Regexp.last_match(1).downcase
|
||||
else
|
||||
:relative
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue