Skip to content

Commit

Permalink
fix: remove protected mode for ...
Browse files Browse the repository at this point in the history
  • Loading branch information
stdword committed Feb 7, 2024
1 parent 63d275c commit 8becb07
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/extensions/customized_eta.ts
Expand Up @@ -109,7 +109,6 @@ const eta = new CustomizedEta({
'``...``': {
trimRight: false,
autoFilter: true,
parseFunction: (meta, content) => ({protectValue: true}),
},
'<%...%>': {
trimRight: false,
Expand Down Expand Up @@ -222,24 +221,6 @@ function compileBody(buff) {
continue
}

if (meta.protectValue) {
if (content.indexOf('`') === -1)
content = `(() => {
try {return eval(\`` + content + `\`)}
catch {return \`` + content + `\`}
})()`
else if (content.indexOf("'") === -1)
content = `(() => {
try {return eval('${content}')}
catch {return '${content}'}
})()`
else
content = `(() => {
try {return eval("${content}")}
catch {return "${content}"}
})()`
}

if (filterFunction)
content = `this.config.parseTags['${currentBlock.t}'].filterFunction('` + content + '\')'

Expand Down

0 comments on commit 8becb07

Please sign in to comment.