diff --git a/VERSION b/VERSION index 4a36342f..cb2b00e4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0 +3.0.1 diff --git a/lib/rdf/rdfa/reader/nokogiri.rb b/lib/rdf/rdfa/reader/nokogiri.rb index 02211152..2ac2bded 100644 --- a/lib/rdf/rdfa/reader/nokogiri.rb +++ b/lib/rdf/rdfa/reader/nokogiri.rb @@ -306,10 +306,10 @@ def doc_base(base) case @host_language when :xhtml1, :xhtml5, :html4, :html5 base_el = @doc.at_css("html>head>base") - base = base_el.attribute("href").to_s.split("#").first if base_el + base = base.join(base_el.attribute("href").to_s.split("#").first) if base_el else xml_base = root.attribute_with_ns("base", RDF::XML.to_s) if root - base = xml_base if xml_base + base = base.join(xml_base) if xml_base end base diff --git a/lib/rdf/rdfa/reader/rexml.rb b/lib/rdf/rdfa/reader/rexml.rb index bcd44274..cf317739 100644 --- a/lib/rdf/rdfa/reader/rexml.rb +++ b/lib/rdf/rdfa/reader/rexml.rb @@ -329,10 +329,10 @@ def doc_base(base) case @host_language when :xhtml1, :xhtml5, :html4, :html5 base_el = ::REXML::XPath.first(@doc, "/html/head/base") rescue nil - base = base_el.attribute("href").to_s.split("#").first if base_el + base = base.join(base_el.attribute("href").to_s.split("#").first) if base_el else xml_base = root.attribute("base", RDF::XML.to_s) if root - base = xml_base if xml_base + base = base.join(xml_base) if xml_base end base || @base_uri diff --git a/spec/reader_spec.rb b/spec/reader_spec.rb index 97190624..36075246 100644 --- a/spec/reader_spec.rb +++ b/spec/reader_spec.rb @@ -428,30 +428,58 @@ end end - it "html>head>base" do - html = %( - - -
-- Learn more by reading the example.org - Example FAQ. -
- - + describe "html>head>base" do + it "uses absolute base" do + html = %( + + + ++ Learn more by reading the example.org + Example FAQ. +
+ + + ) + expected = %q( + @prefix dc:+ Learn more by reading the example.org + Example FAQ. +
+ + + ) + expected = %q( + @prefix dc: