mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Add support for the 'substitution' filter.
This commit is contained in:
parent
ec0c023645
commit
33203eae13
@ -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;
|
||||
}
|
||||
|
||||
########################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user