diff --git a/preview.js b/preview.js index 578ac17..e12b6cb 100644 --- a/preview.js +++ b/preview.js @@ -16,12 +16,14 @@ module.exports = function (config, mongodataInstance) { '\n' + '{{/if}}'; - var getPreviewHTML = function (content ,options, callback) { + var getPreviewHTML = function (content, options, callback) { config.debug && console.log('getPreviewHTML', content); - var promises = replaceMarkers( content, content); - function handler( text, result) { + var promises = replaceMarkers(content, options); + + function handler(text, result) { return text.replace(result.regExp, result.replacement); } + helpers.handTextManipulation(content, promises, handler, @@ -32,22 +34,22 @@ module.exports = function (config, mongodataInstance) { var replaceMarkers = function (html, options) { /* markers: - [type]_[collection]_[name]_[attribute] + [type]__[collection]_[name]_[attribute] script ->