Browse files

Mute plain rel/rev if property is present in HTML5

  • Loading branch information...
1 parent 50e0b7d commit 3916cdf4bf33ad81b636dcd7700d10996805caf4 @niklasl committed Jun 25, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/rdfa/profiles.clj
View
11 src/rdfa/profiles.clj
@@ -119,7 +119,8 @@
el (data :element)
tag (dom/get-name el)
datetime (or (dom/get-attr el "datetime")
- (if (= tag "time") (dom/get-text el)))]
+ (if (= tag "time") (dom/get-text el)))
+ mute-plain-relrev (and (= profile :html) (data :property))]
(assoc data
:base (if (= profile :xml) (dom/get-attr el "xml:base")
nil)
@@ -128,6 +129,14 @@
(empty? resources))
(:id (env :parent-object))))
:lang (or (data :lang) (dom/get-attr el "lang"))
+ :rel (if-let [rel (data :rel)]
+ (if (or (not mute-plain-relrev)
+ (> (.indexOf rel ":") -1))
+ rel))
+ :rev (if-let [rev (data :rev)]
+ (if (or (not mute-plain-relrev)
+ (> (.indexOf rev ":") -1))
+ rev))
:content (or datetime
(if (= tag "data") (dom/get-attr el "value"))
(data :content))

0 comments on commit 3916cdf

Please sign in to comment.