allow for parameterized string functions

now also allow for ending parens

from following, 1, 2, 4 and 5 match, rest are ignored.

	{doc | to_nice_json}}
	{{(doc | to_nice_json)}}
	{{doc | to_nice_json| from_json}}
	{{doc | to_nice_json()}}
	{{doc | to_nice_json(indent=2)}}
	{{doc | to_nice_json(indent=2) | from_json()}}
	{{doc | to_nice_json(indent=2) | from_json}}

fixes #37579
This commit is contained in:
Brian Coca 2018-03-19 13:01:29 -04:00 committed by Brian Coca
parent 0c2e7fd841
commit 5a333859fe

View file

@ -290,7 +290,8 @@ class Templar:
self.environment.block_end_string,
self.environment.variable_end_string
))
self._no_type_regex = re.compile(r'.*\|\s*(?:%s)\s*(?:%s)?$' % ('|'.join(C.STRING_TYPE_FILTERS), self.environment.variable_end_string))
self._no_type_regex = re.compile(r'.*?\|\s*(?:%s)(?:\([^\|]*\))?\s*\)?\s*(?:%s)' %
('|'.join(C.STRING_TYPE_FILTERS), self.environment.variable_end_string))
def _get_filters(self, builtin_filters):
'''