Project

General

Profile

« Previous | Next » 

Revision 1624

xml_func.py: _replace: Strip whitespace from the returned string

View differences:

lib/xml_func.py
184 184
                repl = r'(?<![^\W_])'+repl+r'(?![^\W_])' # match whole word
185 185
            value = re.sub(repl, with_, value)
186 186
    except sre_constants.error, e: raise SyntaxError(e)
187
    return util.none_if(value, u'') # empty strings always mean None
187
    return util.none_if(value.strip(), u'') # empty strings always mean None
188 188
funcs['_replace'] = _replace
189 189

  
190 190
#### Quantities

Also available in: Unified diff