hiccup icon indicating copy to clipboard operation
hiccup copied to clipboard

Using both the class dot notation and attribute map prevents evaluation of local variables

Open benzap opened this issue 7 years ago • 1 comments

The code

(let [class-local-var "class-foo class-bar"]
  (hiccup.page/html5 
   [:body
    [:div.test {:class class-local-var}]]))

Expected output

<!DOCTYPE html>
<html><body><div class="test class-foo class-bar"></div></body></html>

Actual output

<!DOCTYPE html>
<html><body><div class="test class-local-var"></div></body></html>

Note that the symbol class-local-var was not evaluated into class-foo class-bar

Tested on Version 1.0.5

benzap avatar Apr 14 '17 23:04 benzap

This only appears to happen when you include a class with dot notation and through the map attributes :class keyword. The workaround currently would be to only use dot notation or only using map attributes until this is fixed.

benzap avatar Apr 14 '17 23:04 benzap