0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-26 06:31:26 -05:00

🐛 Fix problem with highlight and fonts

This commit is contained in:
alonso.torres 2023-12-05 16:44:42 +01:00
parent c609d2dec6
commit aab53b40bd

View file

@ -10,6 +10,7 @@
["highlight.js" :as hljs]
[app.common.data.macros :as dm]
[app.main.ui.context :as ctx]
[app.util.dom :as dom]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
@ -19,8 +20,10 @@
(let [new-css-system (mf/use-ctx ctx/new-css-system)
block-ref (mf/use-ref)
code (str/trim code)]
(mf/with-effect [code type]
(mf/with-effect
[code type]
(when-let [node (mf/ref-val block-ref)]
(dom/set-data! node "highlighted" nil)
(hljs/highlightElement node)))
(if new-css-system