Back to
Plugin Home
Text Replacers
- Please set this variable to prevent system crash from this page. See section "How it work".
Introduction
Text replacers allow replace one text to other text or replacing text by regular expression. This may usefull for smiles, pictures and logotypes typed as text.
Syntax of definition
To define you custom replacer you must define on TWiki topic (or on included topic) follow tags:
%REPLACE:RE% Here put Regular Expression in Perl format %REPLACE:END%
Or you can use simple syntax:
%REPLACE:TEXT{"Word or string to replace"}% Here put new text %REPLACE:END%
You can also pain the text :). Just define word and color:
%REPLACE:COLOR{"Here put text to coloring"}% color (in HTML format, for example #FDCBAA) %REPLACE:END%
%REPLACE:BGCOLOR{"Here put text to coloring"}% color (in HTML format, for example #FDCBAA) %REPLACE:END%
Using
The
PhantomPlugin automaticaly replace text and you can see that. To define global replacers, please, define it in this
PhantomPluginReplacers topic and you can see action on all TWiki page without additional includes.
How it work
The REPLACE:RE tag invoke
eval Perl command. This tags may readed only from this
PhantomPluginReplacers topic, becose it's not secure to allow everyone to define perl command. Please define ALLOWTOPICCHANGE variable to prevent change this topic by everyone.
The REPLACE:TEXT and REPLACE:COLOR, REPLACE:BGCOLOR tags find and replace text. This tags may readed from all topic.
How to debug
Sometimes replacer not work (RE). This mean that you maybe wrong in RE. You can set DEBUG flag in
PhantomPlugin to 1 and see to data/debug.txt log for errors. List of all replacers avaible in topic you can also see in this log file.
See also
Highlighters
--
AlexeyEfimov - 20 Sep 2002