templates_engine: regexp, don't be greedy

This commit is contained in:
norohind 2021-12-16 14:47:52 +03:00
parent 84bfa8c861
commit 203d859eec
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

View File

@ -7,8 +7,8 @@ from os.path import join
import re
templates_dir = 'templates'
variable_pattern: re.Pattern = re.compile(r'\{\{ .* }}')
include_pattern: re.Pattern = re.compile(r'\{\{ @.* }}')
variable_pattern: re.Pattern = re.compile(r'{{ .*? }}')
include_pattern: re.Pattern = re.compile(r'{{ @.*? }}')
def render(template_name: str, context: dict):