Skip to content

Commit

Permalink
Use substitude operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Leilei332 committed Sep 15, 2024
1 parent 25d3f88 commit 639db07
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/ui/EditorToolbar/file-import.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: $:/core/ui/EditorToolbar/file-import
tags: $:/tags/EditorTools
image: [img[$title$]]
file: [[$title$]]
image: [img[$1$]]
file: [[$1$]]
regexp-search:
regexp-replace:
condition: [<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]
Expand Down
2 changes: 1 addition & 1 deletion core/ui/FileImportTemplate.tid
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: $:/core/ui/FileImportTemplate
\procedure postImportActions()
<$list filter="[<importTitle>links[]]">
<$let escaped-title={{{ [<currentTiddler>search-replace:g:regexp<replacement-regexp>,<replacement-replace>] }}}>
<$let insertText={{{ [get[type]prefix[image]then<replacement-text-image>else<replacement-text-file>search-replace[$title$],<escaped-title>] }}}>
<$let insertText={{{ [get[type]prefix[image]then<replacement-text-image>else<replacement-text-file>substitute<escaped-title>] }}}>
<$action-sendmessage
$message="tm-edit-text-operation"
$param="insert-text"
Expand Down
4 changes: 2 additions & 2 deletions plugins/tiddlywiki/markdown/EditorToolbar/file-import.tid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: $:/plugins/tiddlywiki/markdown/EditorToolbar/file-import
tags: $:/tags/EditorTools
image: ![](<#$title$>)
file: [](<#$title$>)
image: ![](<#$1$>)
file: [](<#$1$>)
regexp-search: [()<>\\]
regexp-replace: \$&
condition: [<targetTiddler>type[text/x-markdown]] [<targetTiddler>type[text/markdown]]
Expand Down

0 comments on commit 639db07

Please sign in to comment.