Skip to content

Commit

Permalink
Fix for unable to recognize file types when image title contain speci…
Browse files Browse the repository at this point in the history
…al characters
  • Loading branch information
Leilei332 committed Aug 1, 2024
1 parent 9557b66 commit f8f705c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/tiddlywiki/markdown/EditorToolbar/file-import.tid
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ condition: [<targetTiddler>type[text/x-markdown]] [<targetTiddler>type[text/mark

\define postImportActions()
\whitespace trim
<$list filter="[<importTitle>links[]search-replace:g:regexp<replacement-regexp>,[\$&]] :reduce[get[type]prefix[image]then<replacement-text-image>else<replacement-text-file>search-replace[$title$],<currentTiddler>addprefix<accumulator>]" variable="imageTitle">
<$list filter="[<importTitle>links[]]">
<$let escaped-title={{{ [<currentTiddler>search-replace:g:regexp<replacement-regexp>,[\$&]] }}}>
<$let insertText={{{ [get[type]prefix[image]then<replacement-text-image>else<replacement-text-file>search-replace[$title$],<escaped-title>] }}}>
<$action-sendmessage
$message="tm-edit-text-operation"
$param="insert-text"
text=<<imageTitle>>
text=<<insertText>>
/>
</$let>
</$let>
</$list>
<<closePopupActions>>
\end
Expand Down

0 comments on commit f8f705c

Please sign in to comment.