Do any of the various batteries included in Babashka have a way to decode XML entities? I want to turn something like "it's not that hard, surely" into "it's not that hard, surely". It seems like https://docs.oracle.com/javase/7/docs/api/javax/xml/bind/DatatypeConverter.html#parseString%28java.lang.String%29 can do it, but that class isn't included in Babashka and would probably suck in a bunch of shit that you don't want. 😬
Indeed, I've avoided javax.xml so far :)
You could cheat by using clojure.data.xml:
(require '[clojure.data.xml :as xml])
(def xml "<root>Don't</root>")
(-> (xml/parse-str xml) :content first)
;; => "Don't"I hope you won't add this abomination to a PR in quickblog though... because then I'm responsible for it
you could also manually process the things with str/replace
user=> (org.jsoup.parser.Parser/unescapeEntities "don't" false)
"don't"@highpressurecarsalesm Lovely! Thank you so much! 🎉
@borkdude Not everything is about quickblog, y'know. 😜
This is actually part of https://codeberg.org/jmglov/cljcastr, my latest bit of silliness.
It got complicated enough that I actually had to add some tests. ðŸ˜
cool, I was afraid my hack would backfire on me! :P
Since when has a hack ever backfired? 😈
one person's hack is another person's main project
I sometimes feel like my editor config is one my main projects, and like it's a collection of hacks 🙃
Haha, I can relate! Moving to Doom Emacs a few years back let me jettison a lot of accumulated cruft, but I still have a few glorious Elisp hacks lying around. My Emacs config file is actually 27 years old, and has just been lugged along from one machine to the next. 😅