fix regexp for templates_engine, dont be greedy

This commit is contained in:
norohind 2021-12-19 00:36:03 +03:00
parent 3d22b716bd
commit 163c5a4a87
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):