fix: Import JSON from Roam has trouble with certain code block syntax

close #2749
pull/3117/head
Tienson Qin 2021-11-11 21:48:00 +08:00
parent 8a5dfe5326
commit d04ce9d9b1
1 changed files with 2 additions and 6 deletions

View File

@ -1,6 +1,7 @@
(ns frontend.external.roam
(:require #?(:cljs [cljs-bean.core :as bean]
:clj [cheshire.core :as json])
#?(:cljs ["/frontend/utils" :as utils])
[frontend.external.protocol :as protocol]
[medley.core :as medley]
[clojure.walk :as walk]
@ -44,12 +45,7 @@
(defn- fenced-code-transform
[text]
(string/replace text
#"```([a-z]*\n[\s\S]*?\n*)```"
(fn [[_ match]]
(str "```"
(str match "\n")
"```"))))
(string/replace text #"```" "\n```"))
(defn load-all-refed-uids!
[data]