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

support mixed hiccup/node representations in html #73

Merged
merged 1 commit into from Sep 9, 2013

Conversation

cemerick
Copy link
Contributor

Currently, html only works with "pure-hiccup" representations, so there's no way to e.g. drop a snippet or other seq of nodes into bits of hiccup-style data.

This patch allows mixed hiccup/node representations to be passed to html so that it only needs to be used once per e.g. transformation.

@cemerick
Copy link
Contributor Author

FYI, this change is available on Clojars as [org.clojars.cemerick/enlive "1.1.3-SNAPSHOT"], if anyone wants to give it a try without cloning.

@cgrand
Copy link
Owner

cgrand commented Sep 2, 2013

@cemerick, I'm about to merge but I just want to double-check your intent: by "so there's no way to e.g. drop a snippet or other seq of nodes into bits of hiccup-style data" you mean literal nodes. Right?

@cemerick
Copy link
Contributor Author

cemerick commented Sep 2, 2013

Literal-or-not seems to be irrelevant AFAICT. html currently only accepts hiccup-style data; it does not allow one to provide e.g. a seq of enlive/clojure.xml-style nodes as the children of a node defined by a vector. This patch is intended to remedy that, recursively.

@cgrand
Copy link
Owner

cgrand commented Sep 9, 2013

There's some ambiguity with the optional attrs-map in hiccup notation. You can field it by looking at the value under :tag. If it's a keyword, it's a node, if it's a string it's an attrs-map.

cgrand added a commit that referenced this pull request Sep 9, 2013
support mixed hiccup/node representations in `html`
@cgrand cgrand merged commit 3bbd9d6 into cgrand:master Sep 9, 2013
@cgrand
Copy link
Owner

cgrand commented Sep 9, 2013

@cemerick thanks and I fixed the ambiguity

@cemerick
Copy link
Contributor Author

cemerick commented Sep 9, 2013

Thanks @cgrand :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants