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:
parent
ada5af5af4
commit
22286aa569
@ -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>
|
||||
"""/>
|
10
plugins/tiddlywiki/markdown/EditorToolbar/picture.tid
Normal file
10
plugins/tiddlywiki/markdown/EditorToolbar/picture.tid
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user