diff --git a/deps/graph-parser/src/logseq/graph_parser/exporter.cljs b/deps/graph-parser/src/logseq/graph_parser/exporter.cljs index f7de18b74c..4809537d06 100644 --- a/deps/graph-parser/src/logseq/graph_parser/exporter.cljs +++ b/deps/graph-parser/src/logseq/graph_parser/exporter.cljs @@ -1017,6 +1017,9 @@ [(get node 4)] (and (vector? node) (= (first node) "Code")) ["`" (second node) "`"] + (and (vector? node) (= (first node) "Email")) + (let [{:keys [local_part domain]} (second node)] + [(str "<" local_part "@" domain ">")]) (and (vector? node) (= "Macro" (first node)) (= "query" (:name (second node)))) (:arguments (second node)) (and (vector? node) (= (first node) "Example")) diff --git a/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs b/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs index 1d924dd276..b952184966 100644 --- a/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs +++ b/deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs @@ -208,6 +208,19 @@ (is (empty? (map :entity (:errors (db-validate/validate-local-db! @conn)))) "Imported graph validates"))) +(deftest-async import-quote-with-email-address + (p/let [file (write-temp-graph-file + "pages/email.md" + "- > \"CachyOS \"\n") + conn (db-test/create-conn) + _ (db-pipeline/add-listener conn) + _ (import-files-to-db [file] conn {})] + (is (= "\"CachyOS \"" + (:block/title (db-test/find-block-by-content @conn #"CachyOS"))) + "Email addresses inside quotes are preserved during import") + (is (empty? (map :entity (:errors (db-validate/validate-local-db! @conn)))) + "Imported graph validates"))) + (deftest update-asset-links-in-block-title (are [x y] (= y (@#'gp-exporter/update-asset-links-in-block-title (first x) {(second x) "UUID"} (atom {})))