Re: Enlive: select a comment, drop all subsequent nodes?

2019-12-16 Thread Alan Thompson
You can be more precise if you use the `tupelo.forest` library for processing tree-like data structures (this will allow you to avoid the trailing `nil` values, for example). Please see the docs , and also the numerous examples

Re: Enlive: select a comment, drop all subsequent nodes?

2019-12-16 Thread Alan Thompson
Quick & dirty technique: (ns tst.demo.core (:use demo.core tupelo.core tupelo.test) (:require [clojure.java.io :as io] [clojure.walk :as walk] [tupelo.parse.tagsoup :as tagsoup] )) (dotest (let [txt(slurp (io/resource "test.html")) >> (println

Re: Enlive: select a comment, drop all subsequent nodes?

2019-12-15 Thread Matching Socks
Indeed "lefts" or "rights" will be the key. A transformation is just a function (open up enlive's html.clj to see how it works), so you can sanity-check yourself by providing a "transformation" that prints out the matched nodes. Feel free to regard Enlive's own transformations as mere

Enlive: select a comment, drop all subsequent nodes?

2019-12-13 Thread Jakub HolĂ˝
Hello! I'd really appreciate help with this problem: I have a blog post containing `` to mark the (prior) part of the text that should be used in previews etc. Given an Enlive DOM tree, how do I get just the preview? I guess I want to 1. Create a selector for the comment node (`{:type :comment,