mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 21:59:34 +08:00
FEATURE: Nokogumbo (#9577)
* FEATURE: Nokogumbo Use Nokogumbo HTML parser.
This commit is contained in:

committed by
GitHub

parent
b8b1cbbfb9
commit
9bff0882c3
@ -8,7 +8,7 @@ class BackfillPostUploadReverseIndex < ActiveRecord::Migration[4.2]
|
||||
|
||||
# fill the reverse index up
|
||||
Post.select([:id, :cooked]).find_each do |post|
|
||||
doc = Nokogiri::HTML::fragment(post.cooked)
|
||||
doc = Nokogiri::HTML5::fragment(post.cooked)
|
||||
# images
|
||||
doc.search("img").each { |img| add_to_reverse_index(img['src'], post.id) }
|
||||
# thumbnails and/or attachments
|
||||
|
@ -30,7 +30,7 @@ SQL
|
||||
|
||||
results.each do |row|
|
||||
post_id, max_id = row["id"].to_i
|
||||
doc = Nokogiri::HTML.fragment(row["cooked"])
|
||||
doc = Nokogiri::HTML5.fragment(row["cooked"])
|
||||
|
||||
uniq = {}
|
||||
|
||||
|
Reference in New Issue
Block a user