This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-15
Channels
- # announcements (10)
- # asami (5)
- # babashka (49)
- # babashka-sci-dev (8)
- # beginners (25)
- # calva (98)
- # cider (2)
- # clj-kondo (22)
- # clojure (32)
- # clojure-dev (12)
- # clojure-europe (32)
- # clojure-nl (3)
- # clojure-spec (3)
- # clojure-uk (10)
- # clojurescript (12)
- # community-development (1)
- # conjure (71)
- # cursive (7)
- # datalog (6)
- # events (2)
- # figwheel-main (2)
- # fulcro (4)
- # jobs (2)
- # kaocha (3)
- # lsp (43)
- # membrane (12)
- # missionary (9)
- # off-topic (61)
- # pathom (7)
- # polylith (2)
- # reagent (38)
- # remote-jobs (4)
- # shadow-cljs (17)
- # specter (1)
- # tools-deps (38)
- # vim (51)
- # web-security (5)
A tiny (~50 LOC) cross-platform CLJC library which parses html into an AST, and then converts it to hiccup. A very good starting point for any html hacking (easy to fork and edit). https://github.com/green-coder/html-to-hiccup
I saw you post the gist on Twitter. Glad you turned it into a full library!
Thx. I think a library makes it easier to maintain and link to it.
The lib has a place for automated tests as well.
This looks great 👏 Presumably the parser is much more strict on well formedness than html5 and browsers? Regardless this looks very useful!
I would say that it is less strict than the browser. For example, there is no check that a closing element has the same tag as its opening element. The parser is not supposed to be used to validate html, just to convert it when it is assumed to be correct.
By the way, I released the version 0.1.3
with the new helper function minify-hiccup
. To know how it works, see its unit tests.
also maybe useful for the same thing is hickory, I think?
Hickory in CLJS nequires the DOM nodes of a browser for the parsing. This one doesn't.
oh!! very excellent point!!