1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-10 20:09:57 +00:00

Add image toolbar dropdown to markdown plugin (#8459)

* Add image toolbar dropdown to markdown plugin

* Escape special characters
This commit is contained in:
Leilei332 2024-07-31 20:38:25 +08:00 committed by GitHub
parent ada5af5af4
commit 22286aa569
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,24 @@
title: $:/plugins/tiddlywiki/markdown/EditorToolbar/picture-dropdown
\define replacement-text()
![](<#$(escaped-text)$>)
\end
\define escapetitle() [()<>\\]
''{{$:/language/Buttons/Picture/Hint}}''
<$macrocall $name="image-picker" actions="""
<$let escaped-text={{{ [<imageTitle>search-replace:g:regexp<escapetitle>,[\$&]] }}}>
<$action-sendmessage
$message="tm-edit-text-operation"
$param="replace-selection"
text=<<replacement-text>>
/>
<$action-deletetiddler
$tiddler=<<dropdown-state>>
/>
</$let>
"""/>

View File

@ -0,0 +1,10 @@
title: $:/plugins/tiddlywiki/markdown/EditorToolbar/picture
list-after: $:/core/ui/EditorToolbar/picture
tags: $:/tags/EditorToolbar
icon: $:/core/images/picture
caption: {{$:/language/Buttons/Picture/Caption}} (Markdown)
description: {{$:/language/Buttons/Picture/Hint}}
condition: [<targetTiddler>type[text/x-markdown]] [<targetTiddler>type[text/markdown]]
shortcuts: ((picture))
dropdown: $:/plugins/tiddlywiki/markdown/EditorToolbar/picture-dropdown