Skip to content

Commit

Permalink
Use preferred-format in "Code Block" shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
jbfil committed Feb 29, 2024
1 parent 7ac3a64 commit ea3d104
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/frontend/commands.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,14 @@
["Embed Twitter tweet" [[:editor/input "{{tweet }}" {:last-pattern command-trigger
:backward-pos 2}]]]

["Code block" [[:editor/input "```\n```\n" {:type "block"
:backward-pos 5
:only-breakline? true}]
["Code block" [(case preferred-format
:markdown [:editor/input "```\n```\n" {:type "block"
:backward-pos 5
:only-breakline? true}]
:org [:editor/input "#+BEGIN_SRC \n#+END_SRC\n"
{:type "block"
:backward-pos 11
:only-breakline? true}])
[:editor/select-code-block-mode]] "Insert code block"]]

@*extend-slash-commands
Expand Down

0 comments on commit ea3d104

Please sign in to comment.