From 33203eae1353ea2601a976e676e8fd1e3e3639d5 Mon Sep 17 00:00:00 2001 From: "ian%hixie.ch" Date: Tue, 2 Sep 2003 15:53:55 +0000 Subject: [PATCH] Add support for the 'substitution' filter. --- config/preprocessor.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/preprocessor.pl b/config/preprocessor.pl index d1ac897ea19b..fe5ae1f6a0db 100755 --- a/config/preprocessor.pl +++ b/config/preprocessor.pl @@ -4,7 +4,7 @@ # Preprocessor # Version 1.0 # -# Copyright (c) 2002 by Ian Hickson +# Copyright (c) 2002, 2003 by Ian Hickson # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,6 +20,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Thanks to bryner and bsmedberg for suggestions. + use strict; # takes as arguments the files to process @@ -414,4 +416,10 @@ sub slashslash { return $text; } +sub substitution { + my($stack, $text) = @_; + $text =~ s/@(\w+)@/$stack->get($1)/gose; + return $text; +} + ########################################################################