Allow template variables to start with an underscore.
authorAdam Sampson <ats@offog.org>
Fri, 21 May 2010 10:53:34 +0000 (10:53 +0000)
committerAdam Sampson <ats@offog.org>
Fri, 21 May 2010 10:53:34 +0000 (10:53 +0000)
NEWS
rawdoglib/rawdog.py

diff --git a/NEWS b/NEWS
index 123cee7ec48449fd539dab264f769c891c978392..565d65f1339e9d997263f592c128bb86d4332de8 100644 (file)
--- 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).
index 7c9c2208925bf202535a61dcfcb0171327a3baa0..212075246e5833c9b809cf1055fd3c6f0c247b7f 100644 (file)
@@ -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__ ..]