Skip to content

Commit

Permalink
perf(tags): use match instead of test
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jul 23, 2020
1 parent d6cb88b commit c12772d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/extend/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class Tag {
// https://hexo.io/docs/tag-plugins#Raw
// https://mozilla.github.io/nunjucks/templating.html#raw
// Only escape code block when there is no raw tag included
return rSwigRawFullBlock.test(str) ? str : escapeSwigTag(str);
return str.match(rSwigRawFullBlock) ? str : escapeSwigTag(str);
});

return Promise.fromCallback(cb => { this.env.renderString(str, options, cb); })
Expand Down

0 comments on commit c12772d

Please sign in to comment.