diff --git a/lib/extend/tag.js b/lib/extend/tag.js index 883fdb5f2f..56bf847117 100644 --- a/lib/extend/tag.js +++ b/lib/extend/tag.js @@ -4,8 +4,6 @@ const stripIndent = require('strip-indent'); const { cyan } = require('chalk'); const nunjucks = require('nunjucks'); const Promise = require('bluebird'); -const placeholder = '\uFFFC'; -const rPlaceholder = /(?:<|<)!--\uFFFC(\d+)--(?:>|>)/g; class NunjucksTag { constructor(name, fn) { @@ -228,15 +226,8 @@ class Tag { options = {}; } - const cache = []; - - const escapeContent = str => ``; - - str = str.replace(/
[\s\S]*?<\/code><\/pre>/gm, escapeContent); - return Promise.fromCallback(cb => { this.env.renderString(str, options, cb); }) - .catch(err => Promise.reject(formatNunjucksError(err, str))) - .then(result => result.replace(rPlaceholder, (_, index) => cache[index])); + .catch(err => Promise.reject(formatNunjucksError(err, str))); } }