Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hiccup-style adapter doesn't cope well with transformation results #127

Open
cemerick opened this issue May 4, 2015 · 2 comments
Open
Assignees
Milestone

Comments

@cemerick
Copy link
Contributor

cemerick commented May 4, 2015

This was surprising:

> (html (at (html [:a])
          [:a] (content "foo")))
ClassCastException   [trace missing]

(Finding the cause was "fun"; there's no stacktrace because the failure is in the destructuring of the first map element in the vector result of at.)

Anyway, the workaround is easy (seq around the result of at). The impl of nodify should probably fall through to the (sequential? node-spec) case if node-spec is a vector with a map for a first element.

@fdserr
Copy link
Collaborator

fdserr commented Jul 10, 2015

Trace back when compiled against clojure 1.7:
ClassCastException clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.Named clojure.core/name (core.clj:1524)
Incoming...

@fdserr
Copy link
Collaborator

fdserr commented Jul 10, 2015

Would this fit?

(html (at (html [:a])
             [:a] (content "foo")))

=> ({:tag :a, :attrs {}, :content ("foo")})

@fdserr fdserr added this to the 1.1.6 milestone Jul 10, 2015
@fdserr fdserr self-assigned this Jul 10, 2015
fdserr pushed a commit that referenced this issue Jul 10, 2015
@fdserr fdserr modified the milestones: 1.1.7, 1.1.6 Jul 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants