diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 9422535396..320539dfbc 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -681,8 +681,8 @@ :page/properties :macros (get name)) - (get-in (state/get-config) [:macros name]) - (get-in (state/get-config) [:macros (keyword name)])) + (get (state/get-macros) name) + (get (state/get-macros) (keyword name))) macro-content (if (and (seq arguments) macro-content) (block/macro-subs macro-content arguments) macro-content)] diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index 067774e16a..9de1696db5 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -142,6 +142,15 @@ ([repo-url] (get-in @state [:config repo-url]))) +(defonce built-in-macros + {"img" "[:img.$4 {:src \"$1\" :style {:width $2 :height $3}}]"}) + +(defn get-macros + [] + (merge + built-in-macros + (:macros (get-config)))) + (defn sub-config [] (sub :config)) @@ -501,11 +510,11 @@ (when token-result (let [{:keys [token expires_at]} token-result] (swap! state update-in [:me :repos] - (fn [repos] - (map (fn [r] - (if (= repo (:url r)) - (merge r {:token token :expires_at expires_at}) - repo)) repos)))))) + (fn [repos] + (map (fn [r] + (if (= repo (:url r)) + (merge r {:token token :expires_at expires_at}) + repo)) repos)))))) (defn set-github-installation-tokens! [tokens] diff --git a/src/main/frontend/version.cljs b/src/main/frontend/version.cljs index 2ddf5eb9f6..2e51ebdbbf 100644 --- a/src/main/frontend/version.cljs +++ b/src/main/frontend/version.cljs @@ -1,3 +1,3 @@ (ns frontend.version) -(defonce version "0.0.4.7-2") +(defonce version "0.0.4.7-3")