Python 的 html.unescape 在 Clojure 中的等价物

Python's html.unescape equivalent in Clojure

在Python3中,我们有这样一个函数

Python 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27) 

>>> from html import unescape

>>> unescaped = unescape("here is ' apostrophe")

>>> print(unescaped)

here is ' apostrophe
>>>

我在 Clojure 中找不到等效项。是否存在基础库函数

图书馆 apache.commons.text 可以完成这项工作:

(ns tst.demo.core
  (:use tupelo.core tupelo.test)
  (:import
    [org.apache.commons.text StringEscapeUtils]))

(dotest
  (let [hng      "hi & goodbye"
        encoded  (StringEscapeUtils/escapeHtml4 hng)]
    (is= encoded "hi & goodbye")
    (is= hng (StringEscapeUtils/unescapeHtml4 encoded))))

Apache 站点有 the full API docs.