fix: add page embeds to page references

pull/1511/head
Tienson Qin 2021-03-19 22:52:03 +08:00
parent a1d4a4d110
commit 2df3fd297d
4 changed files with 10 additions and 11 deletions

View File

@ -72,7 +72,7 @@
"gulp-cached": "^1.1.1",
"ignore": "^5.1.8",
"jszip": "^3.5.0",
"mldoc": "0.5.4",
"mldoc": "0.5.5",
"mousetrap": "^1.6.5",
"path": "^0.12.7",
"react": "^17.0.1",

View File

@ -60,11 +60,11 @@
(and (vector? block)
(= "Macro" (first block)))
(let [{:keys [name arguments]} (second block)]
(when (and (= name "embed")
(string? (first arguments))
(string/starts-with? (first arguments) "[[")
(string/ends-with? (first arguments) "]]"))
(subs (first arguments) 2 (- (count (first arguments)) 2))))
(let [argument (string/join ", " arguments)]
(when (and (= name "embed")
(string? argument)
(text/page-ref? argument))
(text/page-ref-un-brackets! argument))))
:else
nil)]
(when (and

View File

@ -199,7 +199,6 @@
{:embed_blocks embed-blocks
:embed_pages pages-name-and-content}))
(defn export-repo-as-markdown!
[repo]
(when-let [repo (state/get-current-repo)]

View File

@ -3846,10 +3846,10 @@ mkdirp@^0.5.4, mkdirp@~0.5.1:
dependencies:
minimist "^1.2.5"
mldoc@0.5.4:
version "0.5.4"
resolved "https://registry.yarnpkg.com/mldoc/-/mldoc-0.5.4.tgz#3157d2bbd200567a8e5dc9cc9b54ce81c57466c1"
integrity sha512-lNDaxF/ysVML28WYaM3xMA+VDmSURI3CUgyM5p5qwZ+PphFQtgF4+e86sPV7uc1gGE2wRenQZ8F0U9IP1TQNpQ==
mldoc@0.5.5:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mldoc/-/mldoc-0.5.5.tgz#cb7eea471adc94e1c7858d4ae772ddabe0a75753"
integrity sha512-acseZvvwzLNlvp6/fZzqP5rqS80keWOK1XCreem5eXJNxLtJm+xIqzEJVcsmeyFS1Leya1gPT7dMcCUOhEr26g==
dependencies:
yargs "^12.0.2"