Skip to content

:foo/bar renders as bar #135

@greg-at-droit

Description

@greg-at-droit

Thank you for hiccup!

I'm curious what's the thinking behind taking only the name of keywords here?

(extend-protocol ToString
  clojure.lang.Keyword
  (to-str [k] (name k))
  ....

As a result:

user> (hiccup.util/as-str :foo/bar)
"bar"

user> (hiccup.core/html [:p :foo/bar])
"<p>bar</p>"

Now that I understand what's happening, a work-around is to force keywords to str. But it was confusing me for longer than I'd like to admit, so I wanted to ask.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions