Skip to content
This repository
Browse code

Merge branch 'hotfix-0.7.2' into next

  • Loading branch information...
commit 72b699ee11f618bdeb5a8f198b0b9aa675b4e2fa 2 parents 57a58bc + be934f9
Chris Kite authored May 30, 2012
6  CHANGELOG.rdoc
Source Rendered
... ...
@@ -1,3 +1,9 @@
  1
+== 0.7.2 / 2012-05-30
  2
+
  3
+* Bug fixes
  4
+
  5
+  * Fix bug causing anchor links to have '#' converted to '%23'
  6
+
1 7
 == 0.7.1 / 2012-01-20
2 8
 
3 9
 * Minor enhancements
2  VERSION
... ...
@@ -1 +1 @@
1  
-0.7.1
  1
+0.7.2
2  anemone.gemspec
... ...
@@ -1,6 +1,6 @@
1 1
 spec = Gem::Specification.new do |s|
2 2
   s.name = "anemone"
3  
-  s.version = "0.7.1"
  3
+  s.version = "0.7.2"
4 4
   s.author = "Chris Kite"
5 5
   s.homepage = "http://anemone.rubyforge.org"
6 6
   s.rubyforge_project = "anemone"
2  lib/anemone/core.rb
@@ -9,7 +9,7 @@
9 9
 
10 10
 module Anemone
11 11
 
12  
-  VERSION = '0.7.1';
  12
+  VERSION = '0.7.2';
13 13
 
14 14
   #
15 15
   # Convenience method to start a crawl
2  lib/anemone/page.rb
@@ -62,7 +62,7 @@ def links
62 62
       doc.search("//a[@href]").each do |a|
63 63
         u = a['href']
64 64
         next if u.nil? or u.empty?
65  
-        abs = to_absolute(URI(URI.escape(u))) rescue next
  65
+        abs = to_absolute(u) rescue next
66 66
         @links << abs if in_domain?(abs)
67 67
       end
68 68
       @links.uniq!
8  spec/page_spec.rb
@@ -126,6 +126,14 @@ module Anemone
126 126
       end
127 127
     end
128 128
 
  129
+    describe "#links" do
  130
+      it "should not convert anchors to %23" do
  131
+        page = @http.fetch_page(FakePage.new('', :body => '<a href="#top">Top</a>').url)
  132
+        page.links.should have(1).link
  133
+        page.links.first.to_s.should == SPEC_DOMAIN
  134
+      end
  135
+    end
  136
+
129 137
     it "should detect, store and expose the base url for the page head" do
130 138
       base = "#{SPEC_DOMAIN}path/to/base_url/"
131 139
       page = @http.fetch_page(FakePage.new('body_test', {:base => base}).url)

0 notes on commit 72b699e

Please sign in to comment.
Something went wrong with that request. Please try again.