Module talk:Escape/testcases
Sarna News
- HEXTECH Review - Wave 3 Brings More Urban Options To Your Battlefield
- Your BattleTech News Round-Up For March, 2024
- Crashing 'Mechs With Jennifer Brozek, Author Of The Rogue Academy Trilogy
- Getting The Word Out With Rem Alternis, Catalyst Community & Marketing Director
- Bad 'Mechs - Yeoman
- Read more →
Contents
- 1 Original:
- 2 Using internal method to remove {:
- 3 Using {{replace}} to remove {:
- 4 No removal of { between escape/unescape (escape char not restored):
- 5 Restore to original after escape
- 6 Remove the word test if not escaped and then place a different escape char in the place of the old escape char (for use by something else):
Original:[edit]
test { test {\{ test, \test, \{,test\ \ \ {\
Using internal method to remove {
:[edit]
{{#invoke:Escape|main|mode=kill|test { test {\{ test, \test, \{,test\ \ \ {\|{}}
test test { test, test, {,test \
Using {{replace}} to remove {
:[edit]
{{#invoke:Escape|main|mode=undo|{{replace|{{#invoke:Escape|main|mode=text|test { test {\{ test, \test, \{,test\ \ \ {\}}|{|}}}}
test test { test, test, {,test \
No removal of {
between escape/unescape (escape char not restored):[edit]
{{#invoke:Escape|main|mode=undo |{{#invoke:Escape|main|mode=text|test { test {\{ test, \test, \{,test\ \ \ {\}} }}
test { test {{ test, test, {,test {\
Restore to original after escape[edit]
{{#invoke:Escape|main|mode=undo |{{#invoke:Escape|main|mode=text|test { test {\{ test, \test, \{,test\ \ \ {\}} |\ }}
test { test {\{ test, \test, \{,test\ \ \ {\
Remove the word test
if not escaped and then place a different escape char in the place of the old escape char (for use by something else):[edit]
Note: The '%' char is a special in Lua, so use '%%' if that is the desired replacement. Otherwise, just a single char is fine (or a word).
{{#invoke:Escape|main|mode=kill |test { test {\{ test, \test, \{,test\ \ \ {\ |test |%% }}
{ {%{ , %test, %{,% % % {\