Skip to content

Commit

Permalink
fix: tweak regexp to simplify code and document escaping rules
Browse files Browse the repository at this point in the history
  • Loading branch information
saqimtiaz committed Aug 9, 2024
1 parent 19c1224 commit aec092e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/ui/EditorToolbar/file-import.tid
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ condition: [<targetTiddler>filter{$:/config/Editor/EnableImportFilter}]
\procedure tw5-ImageTemplate() [img[$(currentTiddler)$]]
\procedure tw5-FileTemplate() [[$(currentTiddler)$]]

\procedure escape-regexp() [()<>\\]
\function escape.title() [search-replace:g:regexp<escape-regexp>,[\$&]]
<!-- The following characters must be escaped in markdown: <>()\ -->
\function escape.title() [search-replace:g:regexp[\(|\)|<|>|\\],[\$&]]
\procedure markdown-ImageTemplate() ![](<#${ [<currentTiddler>escape.title[]] }$>)
\procedure markdown-FileTemplate() [](<#${ [<currentTiddler>escape.title[]] }$>)

Expand Down

0 comments on commit aec092e

Please sign in to comment.