Skip to content

Commit

Permalink
fix: add page embeds to page references
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Mar 19, 2021
1 parent a1d4a4d commit 2df3fd2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions src/main/frontend/format/block.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/main/frontend/handler/export.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3846,10 +3846,10 @@ mkdirp@^0.5.4, mkdirp@~0.5.1:
dependencies:
minimist "^1.2.5"

[email protected].4:
version "0.5.4"
resolved "https://registry.yarnpkg.com/mldoc/-/mldoc-0.5.4.tgz#3157d2bbd200567a8e5dc9cc9b54ce81c57466c1"
integrity sha512-lNDaxF/ysVML28WYaM3xMA+VDmSURI3CUgyM5p5qwZ+PphFQtgF4+e86sPV7uc1gGE2wRenQZ8F0U9IP1TQNpQ==
[email protected].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"

Expand Down

0 comments on commit 2df3fd2

Please sign in to comment.