Hyperfiddle markdown integrations (2017)

Hyperfiddle has been through all of the markdown renderers (both clojure and javascript). The different types of features to balance, and implementation-specific nuances / issues / bugs are too many and too complicated to list (though reddit votes do have a way of helping me find time to elucidate).
We settled on https://github.com/remarkjs/remark, so far, which meets our requirements of

cljs eval from markdown

(1 1 2 3 5 8 13 21 34 55)

inline styles

hello world

inline codemirror, try typing in it

{:hello "r/clojure" :from :markdown}

Here is the Reagent integrations

(defn code-editor-wrap-argv [{:keys [value change!] :as props}] [hypercrud.ui.code-editor/code-editor* value change! props]) (def whitelist {"span" (fn [props] [:span (dissoc props :children :value) (:value props)]) ; Div is not needed, use it with block syntax and it hits React.createElement and works ; see https://github.com/medfreeman/remark-generic-extensions/issues/30 "CodeEditor" code-editor-wrap-argv}) ; https://github.com/medfreeman/remark-generic-extensions (defn markdown [value change! & [props]] (let [children (-> (js/remark) (.use js/remarkGenericExtensions (clj->js {"elements" {"span" {"html" {"properties" {"value" "::content::"}}} "CodeEditor" {"html" {"properties" {"value" "::content::"}}}}})) (.use js/remarkReact (clj->js {"sanitize" false "remarkReactComponents" (util/map-values r/reactify-component whitelist)})) (.processSync value {"commonmark" true}) .-contents)] [:div.markdown {:class (:class props)} children]))