mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 07:49:29 +00:00
Change some instances of Nokogiri HTML4 parsing to HTML5 (#31812)
This commit is contained in:
@@ -52,7 +52,7 @@ class Sanitize
|
||||
:relative
|
||||
end
|
||||
|
||||
current_node.replace(Nokogiri::XML::Text.new(current_node.text, current_node.document)) unless LINK_PROTOCOLS.include?(scheme)
|
||||
current_node.replace(current_node.document.create_text_node(current_node.text)) unless LINK_PROTOCOLS.include?(scheme)
|
||||
end
|
||||
|
||||
UNSUPPORTED_ELEMENTS_TRANSFORMER = lambda do |env|
|
||||
|
||||
@@ -13,7 +13,7 @@ def gen_border(codepoint, color)
|
||||
view_box[3] += 4
|
||||
svg['viewBox'] = view_box.join(' ')
|
||||
end
|
||||
g = Nokogiri::XML::Node.new 'g', doc
|
||||
g = doc.create_element('g')
|
||||
doc.css('svg > *').each do |elem|
|
||||
border_elem = elem.dup
|
||||
|
||||
|
||||
Reference in New Issue
Block a user