feat: support org mode file links (#681)

* feat: support org-mode file links

Add a `:org-mode/insert-file-links` option to configuration.
This commit is contained in:
Tienson Qin
2020-11-18 07:27:40 -06:00
committed by GitHub
parent 85a1837004
commit 5d3b6322f5
8 changed files with 180 additions and 70 deletions

View File

@@ -30,10 +30,8 @@
[frontend.handler.image :as image-handler]
[frontend.commands :as commands
:refer [*show-commands
*matched-commands
*slash-caret-pos
*angle-bracket-caret-pos
*matched-block-commands
*show-block-commands]]
[frontend.extensions.html-parser :as html-parser]
[medley.core :as medley]
@@ -1363,6 +1361,10 @@
:or {restore? true}
:as option}]
(cond
(fn? command-output)
(let [s (command-output)]
(commands/insert! id s option))
;; replace string
(string? command-output)
(commands/insert! id command-output option)
@@ -1527,7 +1529,7 @@
(when (> pos 0)
(or
(and (= \/ (util/nth-safe edit-content (dec pos)))
(commands/commands-map))
@commands/*initial-commands)
(and last-command
(commands/get-matched-commands last-command)))))
(catch js/Error e