refactor: simplify clojure lang mode setting

This commit is contained in:
Andelf
2021-12-18 21:20:59 +08:00
committed by Tienson Qin
parent 9eb7c6f820
commit 0e570ba45b
2 changed files with 2 additions and 6 deletions

View File

@@ -270,10 +270,7 @@
(when-let [mode (:data-lang attr)]
(when-not (= mode "calc")
[:div.extensions__code-lang
(let [mode (string/lower-case mode)]
(if (= mode "text/x-clojure")
"clojure"
mode))]))
(string/lower-case mode)]))
[:textarea (merge {:id id
;; Expose the textarea associated with the CodeMirror instance via
;; ref so that we can autofocus into the CodeMirror instance later.