mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
Replace Hpricot with Nokogiri
This commit is contained in:
@ -19,7 +19,10 @@ describe CookedPostProcessor do
|
||||
end
|
||||
|
||||
it 'inserts the onebox' do
|
||||
@cpp.html.should == "GANGNAM STYLE"
|
||||
@cpp.html.should == <<EXPECTED
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<html><body>GANGNAM STYLE</body></html>
|
||||
EXPECTED
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ private
|
||||
<h3><a href="http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177" target="_blank">The Ruby Programming Language (Paperback)</a></h3>
|
||||
<h4>David Flanagan, Yukihiro Matsumoto</h4>
|
||||
|
||||
The Ruby Programming Language is the authoritative guide to Ruby ...
|
||||
The Ruby Programming Language is the authoritative guide to Ruby ...
|
||||
|
||||
</div>
|
||||
<div class='clearfix'></div>
|
||||
|
@ -25,7 +25,10 @@ private
|
||||
<img src="https://lh5.ggpht.com/wrYYVu74XNUu2WHk0aSZEqgdCDCNti9Fl0_dJnhgR6jY04ajQgVg5ABMatfcTDsB810=w124" class="thumbnail">
|
||||
<h3><a href="https://play.google.com/store/apps/details?id=com.moosoft.parrot" target="_blank">Talking Parrot</a></h3>
|
||||
|
||||
Listen to the parrot repeat what you say. A Fun application for all ages. Upgrade to Talking Parrot Pro to save sounds, set them as your ringtone and control recording. Press the MENU button to access the settings where you can change the record time and repeat count. This app uses anonymous usage stats to understand and improve performance. Comments and feedback welcome.
|
||||
Listen to the parrot repeat what you say. A Fun application for all ages. Upgrade to Talking Parrot Pro to save sounds, set them as your ringtone and control recording.
|
||||
Press the MENU button to access the settings where you can change the record time and repeat count.
|
||||
This app uses anonymous usage stats to understand and improve performance.
|
||||
Comments and feedback welcome.
|
||||
</div>
|
||||
<div class='clearfix'></div>
|
||||
</div>
|
||||
|
@ -145,16 +145,16 @@ describe Oneboxer do
|
||||
|
||||
it 'yields each url and element when given a string' do
|
||||
result = Oneboxer.each_onebox_link(@html) do |url, element|
|
||||
element.is_a?(Hpricot::Elem).should be_true
|
||||
element.is_a?(Nokogiri::XML::Element).should be_true
|
||||
url.should == 'http://discourse.org'
|
||||
end
|
||||
result.kind_of?(Hpricot::Doc).should be_true
|
||||
result.kind_of?(Nokogiri::HTML::Document).should be_true
|
||||
end
|
||||
|
||||
it 'yields each url and element when given a doc' do
|
||||
doc = Hpricot(@html)
|
||||
doc = Nokogiri::HTML(@html)
|
||||
Oneboxer.each_onebox_link(doc) do |url, element|
|
||||
element.is_a?(Hpricot::Elem).should be_true
|
||||
element.is_a?(Nokogiri::XML::Element).should be_true
|
||||
url.should == 'http://discourse.org'
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user