mirror of
https://github.com/mastodon/mastodon.git
synced 2026-09-14 04:07:37 -05:00
Merge commit from fork
* add guard clause to check for node attributes * check for encoding attribute specifically * change spec
This commit is contained in:
@@ -83,8 +83,10 @@ class Sanitize
|
||||
# next, we find the plain-text description
|
||||
is_annotation_with_encoding = lambda do |encoding, node|
|
||||
return false unless node.name == 'annotation'
|
||||
encoding_attr = node.attributes['encoding']
|
||||
return false if encoding_attr.nil?
|
||||
|
||||
node.attributes['encoding'].value == encoding
|
||||
encoding_attr.value == encoding
|
||||
end
|
||||
|
||||
annotation = semantics.children.find(&is_annotation_with_encoding.curry['application/x-tex'])
|
||||
|
||||
Reference in New Issue
Block a user