From: Adam Sampson Date: Fri, 21 May 2010 10:53:34 +0000 (+0000) Subject: Allow template variables to start with an underscore. X-Git-Tag: v2.13~4 X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=4f8063563668b919a211548b7f837308a8a9b182;p=rawdog%2F.git Allow template variables to start with an underscore. --- diff --git a/NEWS b/NEWS index 123cee7..565d65f 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,9 @@ Joseph Reagle). If neither is available, "tidyhtml true" just does nothing, so it's now turned on in the provided config file. The mxtidy_args hook is now called tidy_args. +Allow template variables to start with an underscore (patch from Oberon +Faelord). + - rawdog 2.12 Make rawdog work with Python 2.6 (reported by Roy Lanek). diff --git a/rawdoglib/rawdog.py b/rawdoglib/rawdog.py index 7c9c220..2120752 100644 --- a/rawdoglib/rawdog.py +++ b/rawdoglib/rawdog.py @@ -231,7 +231,7 @@ def string_to_html(s, config): """Convert a string to HTML.""" return sanitise_html(cgi.escape(s), "", True, config) -template_re = re.compile(r'(__.*?__)') +template_re = re.compile(r'(__[^_].*?__)') def fill_template(template, bits): """Expand a template, replacing __x__ with bits["x"], and only including sections bracketed by __if_x__ .. [__else__ ..]