chore: for goodness' sake

This commit is contained in:
Daniel Roe 2024-05-08 16:17:47 +01:00
parent 0e12b6eb8b
commit 3708ee8721
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -80,7 +80,7 @@ export const RenderPlugin = () => {
// Serialize into a js function // Serialize into a js function
const chunks = html.split(/\{{2,3}\s*[^{}]+\s*\}{2,3}/g).map(chunk => JSON.stringify(chunk)) const chunks = html.split(/\{{2,3}\s*[^{}]+\s*\}{2,3}/g).map(chunk => JSON.stringify(chunk))
let hasMessages = chunks.length > 1 const hasMessages = chunks.length > 1
let templateString = chunks.shift() let templateString = chunks.shift()
for (const expression of html.matchAll(/\{{2,3}(\s*[^{}]+\s*)\}{2,3}/g)) { for (const expression of html.matchAll(/\{{2,3}(\s*[^{}]+\s*)\}{2,3}/g)) {
templateString += ` + (${expression[1].trim()}) + ${chunks.shift()}` templateString += ` + (${expression[1].trim()}) + ${chunks.shift()}`