@koha-community/prettier-plugin-template-toolkit
Version:
Prettier plugin for formatting Template::Toolkit templates.
8 lines (6 loc) • 1.02 kB
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>(?<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\S])*?)%\])|\[%(?<startDelimiter>(?:[\-~])?)\s*(?<statement>(?<keyword>IF|ELSE|ELSIF|UNLESS|FOREACH|FOR|WHILE|FILTER|WRAPPER|MACRO|BLOCK|\w+\s?=\s?BLOCK|SWITCH|CASE|END)(?:\s+(?:'[^']*'|"[^"]*")|(?:[\s\S]))*?)\s*(?<endDelimiter>(?:[\-~])?)%\]|\[%(?<startDelimiterEx>(?:[\-~])?)\s*(?<expression>(?:(?=((?:'[^']*'|"[^"]*")|(?:[\s\S])))\10)*?)\s*(?<endDelimiterEx>(?:[\-~])?)%\]|(?<scriptBlock>(?<scriptOpeningTag><script(?:\s+[^>]*?)?>)(?<scriptContent>[\s\S]*?)(?<scriptClosingTag><\/script>))|(?<styleBlock><style(?:(?:[\s\S])*?)>(?:(?:[\s\S])*?)<\/style>\s*))/u;