mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 02:46:45 +00:00
fix: Import JSON from Roam has trouble with certain code block syntax
close #2749
This commit is contained in:
8
src/main/frontend/external/roam.cljc
vendored
8
src/main/frontend/external/roam.cljc
vendored
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user