mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 18:59:42 +00:00
5202441769
* Add suffix and parameter to trim operator Fixes #4809 * Unit tests for new trim operator parameters * Mention trim operator in 5.1.23 release notes * Address review comments * Move regex escaping into utils.js trim functions This way the trimPrefix and trimSuffix functions from utils.js are safe to call without regex-escaping their parameters, which should make them easier to use from other parts of the Javascript code.
16 lines
676 B
Plaintext
16 lines
676 B
Plaintext
created: 20190613153847475
|
|
modified: 20190613153924808
|
|
tags: [[trim Operator]] [[Operator Examples]]
|
|
title: trim Operator (Examples)
|
|
type: text/vnd.tiddlywiki
|
|
|
|
<<.operator-example 1 "[[ a b ]trim[]addprefix[-]addsuffix[-]]">>
|
|
|
|
<<.operator-example 2 "[[ abc ]] [[def ]] [[ ghi]] +[trim[]addprefix[-]addsuffix[-]]">>
|
|
<<.operator-example 3 "[[ abc ]] [[def ]] [[ ghi]] +[trim:prefix[]addprefix[-]addsuffix[-]]">>
|
|
<<.operator-example 4 "[[ abc ]] [[def ]] [[ ghi]] +[trim:suffix[]addprefix[-]addsuffix[-]]">>
|
|
|
|
<<.operator-example 5 "abacus baobab +[trim[ab]]">>
|
|
<<.operator-example 6 "abacus baobab +[trim:prefix[ab]]">>
|
|
<<.operator-example 7 "abacus baobab +[trim:suffix[ab]]">>
|