Jump to content

Module talk:Escape/testcases

Page contents not supported in other languages.
From Simple English Wikipedia, the free encyclopedia
Revision as of 00:00, 9 August 2021 by MeritedElm63160 (talk | changes) (Created page with "====Original:==== {{#invoke:Escape/testcases|test_string2}} ====Using internal method to remove {{code|{}}:==== {{demo |br=0 |{{escape|mode=kill |char=! |{*{#invoke:Escape!main!mode{{=}}kill!{{#invoke:Escape/testcases|test_string2}}!{}*} |* |{{!}} }}}} ====Using {{t|replace}} to remove {{code|{}}:==== {{demo|br=0|{{escape|mode=kill|char=!|{*{#invoke:Escape!main!mode{{=}}undo!{*{replace!{*{#invoke:Escape!main!mode{{=}}text!{{#invoke:Escape/testcases|test_strin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Original:

test { test {\{ test, \test, \{,test\ \ \ {\

Using internal method to remove {:

{{#invoke:Escape|main|mode=kill|test { test {\{ test, \test, \{,test\ \ \ {\|{}}

test test { test, test, {,test \

Using {{replace}} to remove {:

{{#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):

{{#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

{{#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):

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, %{,% % % {\