This commit is contained in:
Kovid Goyal 2014-06-27 15:09:06 +05:30
commit 35e5985b7e

View File

@ -499,13 +499,14 @@ class TemplateFormatter(string.Formatter):
########## a formatter that throws exceptions ############
def unsafe_format(self, fmt, kwargs, book):
def unsafe_format(self, fmt, kwargs, book, strip_results=True):
self.strip_results = strip_results
self.column_name = self.template_cache = None
self.kwargs = kwargs
self.book = book
self.composite_values = {}
self.locals = {}
return self.evaluate(fmt, [], kwargs).strip()
return self.evaluate(fmt, [], kwargs)
########## a formatter guaranteed not to throw an exception ############