Tags:
create new tag
, view all tags

Back to Plugin Home

Text Replacers

  • Please set this variable to prevent system crash from this page. See section "How it work".
    • Set ALLOWTOPICCHANGE =

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

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2002-09-20 - AlexeyEfimov
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.