From 3331cad8424cf3352dac8be74120ffdd2bb90295 Mon Sep 17 00:00:00 2001 From: eltrac Date: Mon, 21 Sep 2026 20:29:38 +0800 Subject: README: update clojure code --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cefe8c..70c4f9f 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,9 @@ func parse() int32 { ```clojure ;; src/mf2clj/core.clj (ns mf2clj.core - (:require [clojure.java.io :as io]) + (:require [clojure.java.io :as io] + [clojure.walk :refer [keywordize-keys]] + [cheshire.core :as json]) (:import [org.extism.sdk.chicory Manifest ManifestWasm Plugin] [java.nio.charset StandardCharsets])) @@ -81,7 +83,10 @@ func parse() int32 { (defn parse [html-string] (let [charset StandardCharsets/UTF_8 html-bytes (.getBytes html-string charset)] - (String. (.call plugin "parse" html-bytes) charset))) + (-> (.call plugin "parse" html-bytes) + (String. charset) + json/parse-string + keywordize-keys))) ``` Seriously, that's all of it. -- cgit v1.2.3