reorganizes spec cases and fixes a couple few
This commit is contained in:
parent
ed58788884
commit
c74ecef194
158 changed files with 46 additions and 42 deletions
|
@ -17,7 +17,7 @@ module Microformats2
|
|||
|
||||
def read_html(html)
|
||||
open(html).read
|
||||
rescue Errno::ENOENT => e
|
||||
rescue Errno::ENOENT, Errno::ENAMETOOLONG => e
|
||||
html
|
||||
end
|
||||
end # class << self
|
||||
|
|
|
@ -32,15 +32,15 @@ module Microformats2
|
|||
|
||||
class Url < Property::Parser
|
||||
def parse_flat_element(element)
|
||||
(element.attribute("href") || property.text).to_s
|
||||
(element.attribute("href") || element.attribute("src") || element.text).to_s
|
||||
end
|
||||
end
|
||||
|
||||
class DateTime < Property::Parser
|
||||
def parse_flat_element(element)
|
||||
::DateTime.parse(element.attribute("datetime") || property.text)
|
||||
::DateTime.parse(element.attribute("datetime") || element.text)
|
||||
rescue ArgumentError => e
|
||||
element.attribute("datetime") || property.text
|
||||
(element.attribute("datetime") || element.text).to_s
|
||||
end
|
||||
def hash_safe_value
|
||||
@value.to_s
|
||||
|
@ -49,7 +49,7 @@ module Microformats2
|
|||
|
||||
class Embedded < Property::Parser
|
||||
def parse_flat_element(element)
|
||||
element.text.gsub(/\n+/, " ").gsub(/\s+/, " ").strip
|
||||
element.inner_html.strip
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue