prettier-plugin-jinja-template
Version:
Prettier plugin for formatting jinja templates.
8 lines (6 loc) • 882 B
text/typescript
/*
Do not edit this file!!!
The file "src/regex_editable.ts" contains the source for this regex and is transformed by "babel-plugin-transform-regex".
Run "npm run build:regex" to generate this file again afer editing the source.
*/
export default /(?<node>\{\{(?<startDelimiterEx>(?:[\-+])?)\s*(?<expression>(?:(?=((?:'[^']*'|"[^"]*")|(?:[\s\S])))\4)*?)\s*(?<endDelimiterEx>(?:[\-+])?)\}\}|\{%(?<startDelimiter>(?:[\-+])?)\s*(?<statement>(?<keyword>\w+)(?:(?=((?:'[^']*'|"[^"]*")|(?:[\s\S])))\9)*?)\s*(?<endDelimiter>(?:[\-+])?)%\}|(?<ignoreBlock>(?:<!--\s*prettier-ignore-start\s*-->|\{#\s*prettier-ignore-start\s*#\})(?:(?:[\s\S])*?)(?:<!--\s*prettier-ignore-end\s*-->|\{#\s*prettier-ignore-end\s*#\}))|(?<comment>\{#(?:(?:[\s\S])*?)#\})|(?<scriptBlock><script(?:(?:[\s\S])*?)>(?:(?:[\s\S])*?)<\/script>\s*)|(?<styleBlock><style(?:(?:[\s\S])*?)>(?:(?:[\s\S])*?)<\/style>\s*))/u;