Merge remote-tracking branch 'parent/stable-4.3' into kb-draft-15.12-lts
This commit is contained in:
commit
97647cbbc0
108 changed files with 1729 additions and 1018 deletions
|
@ -24,7 +24,15 @@ class EmojiFormatter
|
|||
def to_s
|
||||
return html if custom_emojis.empty? || html.blank?
|
||||
|
||||
tree = Nokogiri::HTML5.fragment(html)
|
||||
begin
|
||||
tree = Nokogiri::HTML5.fragment(html)
|
||||
rescue ArgumentError
|
||||
# This can happen if one of the Nokogumbo limits is encountered
|
||||
# Unfortunately, it does not use a more precise error class
|
||||
# nor allows more graceful handling
|
||||
return ''
|
||||
end
|
||||
|
||||
tree.xpath('./text()|.//text()[not(ancestor[@class="invisible"])]').to_a.each do |node|
|
||||
i = -1
|
||||
inside_shortname = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue