diff --git a/src/parser.ts b/src/parser.ts index 8c26355..e16984b 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -10,7 +10,7 @@ import { } from "./jinja"; const regex = - /(?
(?\n)?(\s*?))(? {{\s*(? '([^']|\\')*'|"([^"]|\\")*"|[\S\s]*?)\s*}}|{%(? [-\+]?)\s*(? (? for|endfor|if|else|endif|macro|endmacro|call|endcall|filter|endfilter|set|endset|include|import|from|extends|block|endblock)('([^']|\\')*'|"([^"]|\\")*"|[\S\s])*?)\s*(? [-\+]?)%}|(? {#[\S\s]*?#})|(? <(script)((?!<)[\s\S])*>((?!<\/script)[\s\S])*?{{[\s\S]*?<\/(script)>)|(? <(style)((?!<)[\s\S])*>((?!<\/style)[\s\S])*?{{[\s\S]*?<\/(style)>)|(? [\s\S]*))/; + /(? (?\n)?(\s*?))(? {{\s*(? '([^']|\\')*'|"([^"]|\\")*"|[\S\s]*?)\s*}}|{%(? [-+]?)\s*(? (? for|endfor|if|else|endif|macro|endmacro|call|endcall|filter|endfilter|set|endset|include|import|from|extends|block|endblock)('([^']|\\')*'|"([^"]|\\")*"|[\S\s])*?)\s*(? [-+]?)%}|(? {#[\S\s]*?#})|(? <(script)((?!<)[\s\S])*>((?!<\/script)[\s\S])*?{{[\s\S]*?<\/(script)>)|(? <(style)((?!<)[\s\S])*>((?!<\/style)[\s\S])*?{{[\s\S]*?<\/(style)>)|(? [\s\S]*))/; export const parse: Parser ["parse"] = (text) => { const statementStack: Statement[] = [];