Merge commit from fork

* add guard clause to check for node attributes

* check for encoding attribute specifically

* change spec
This commit is contained in:
Pia B.
2026-06-03 12:12:37 +02:00
committed by GitHub
parent ad8539385d
commit 2c103cc487
2 changed files with 11 additions and 1 deletions

View File

@@ -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'])