1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-29 16:53:14 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/filters/examples/trim Operator (Examples).tid
Robin Munn 5202441769
Add suffix and parameter to trim operator (#4811)
* 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.
2020-08-29 12:27:58 +01:00

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]]">>