Comments (4)
Hm, I think I rushed to conclusions. Maybe the problem somewhere in the environment. Closing for now.
from enlive.
Snippets with destructures args works on my box.
user=> (defsnippet foo (java.io.StringReader. "
[{:keys [body]}] [:div](content body))
#'user/foo
user=> (foo {:body "World"})
({:tag :body, :attrs nil, :content ({:tag :div, :attrs nil, :content
("World")})})
Can you provide an example with no external dependency and that reproduce
the bug in a fresh repl?
Thanks.
On Sun, Jun 5, 2011 at 10:20 AM, dnaumov <
[email protected]>wrote:
Following snippet returns passed map as a content of #name element:
(defsnippet details (path "details.html") [:div#details]
[{:keys [name desc price capacity order-url photos-urls]}]
[:#name](content name)
[:#desc](content desc)
[:#price](append price)
[:#capacity](append capacity)
[:a#order](set-attr :href order-url)
[:#photos :img](clone-for [u photos-urls]
%28set-attr :src u%29))But this snippet works well:
(defsnippet details (path "details.html") [:div#details]
[x]
[:#name](content %28:name x%29)
[:#desc](content %28:desc x%29)
[:#price](append %28:price x%29)
[:#capacity](append %28:capacity x%29)
[:a#order](set-attr :href %28:order-url x%29)
[:#photos :img](clone-for [u %28:photos-urls x%29]
%28set-attr :src u%29))Enllive 1.0.0 and Clojure 1.2.1
Reply to this email directly or view it on GitHub:
#23
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.cgrand.net/ (en)
from enlive.
It's not a bug, there was problem in my code.
I'm sorry to have troubled you.
from enlive.
That's ok but github notifications are broken: I didn't get your first comment and that you closed the issue...
from enlive.
Related Issues (20)
- Automated CSS selector translation to vector form HOT 5
- [org.jsoup/jsoup "1.8.3"] exists HOT 1
- Make JSoup the default for enlive 1.2 HOT 1
- StackOverflowError when parsing certain html HOT 4
- Composable selector/transform in snippet HOT 1
- Simple variable substitution (with example) in meta tag throwing NullPointerException HOT 2
- Less obscure error messages
- first-child
- End tag for <col> violates the specs
- javax.net.ssl.SSLHandshakeException while trying to reach some resources HOT 1
- attribute matching inside at-form HOT 1
- "safe write" "feature" in IntelliJ prevents auto-reloading of namespace depending on changed HTML
- Removing element cleanly HOT 2
- Is this project dead? HOT 1
- Update jsoup dependency to v1.11.3+
- Setting HTTP headers HOT 1
- Broken wiki link in project description
- HTML resource not found
- Any interest in CSS-style selector syntax option? HOT 1
- [BUG] Some tags are loosing part of their content when selected.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enlive.