diff options
| author | eltrac <hi@eltr.ac> | 2026-09-21 20:29:38 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-09-21 20:29:38 +0800 |
| commit | 3331cad8424cf3352dac8be74120ffdd2bb90295 (patch) | |
| tree | 394ef3fdffbcbb482c7ab56c1cec0c0ab0af7cd8 | |
| parent | bb4d7ae37f3cb28cdcac2540407420bb9f2ee68a (diff) | |
README: update clojure code
| -rw-r--r-- | README.md | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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.
|
