Name

lspace_to_nbsp — replace leading spaces (" ") with nonbreakable space (" ") characters

DESCRIPTION

The filter replaces leading space (" ") characters with HTML's nonbreakable-space (" ") characters.

This is similar in functionality to space_to_nbsp filter, where all space (not just leading) is converted.

EXAMPLES

Example: Filter example

</div>
[filter lspace_to_nbsp]
          Text with leading whitespace.
[/filter]
</div>

          

NOTES

AVAILABILITY

lspace_to_nbsp is available in Interchange versions:

4.6.0-5.7.0 (git-head)

SOURCE

Interchange 5.7.0:

Source: code/Filter/lspace_to_nbsp.filter
Lines: 19


# Copyright 2002-2007 Interchange Development Group and others
# 
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.
# 
# $Id: lspace_to_nbsp.filter,v 1.2 2007-03-30 23:40:44 pajamian Exp $

CodeDef lspace_to_nbsp Filter
CodeDef lspace_to_nbsp Description Leading SPACE to nbsp
CodeDef lspace_to_nbsp Routine <<EOR
sub {
my $str = shift;
$str =~ s/^( +)/'&nbsp;' x length($1)/emg;
return $str;
}
EOR


AUTHORS

Interchange Development Group

SEE ALSO

space_to_nbsp(7ic), space_to_null(7ic)

DocBook! Interchange!