diff --git a/src/inject/index.js b/src/inject/index.js index b0cdedd..f89b9f6 100644 --- a/src/inject/index.js +++ b/src/inject/index.js @@ -185,8 +185,14 @@ function getNewContent (target, collection, opt) { var startTag = tags[tag].start; var endTag = tags[tag].end; + var injectorTagsRegExp = getInjectorTagsRegExp(startTag, endTag); + + if (!injectorTagsRegExp.test(contents)) { + throw error('Missing inject tags!'); + } + return contents.replace( - getInjectorTagsRegExp(startTag, endTag), + injectorTagsRegExp, function injector (match, starttag, indent, content, endtag) { var starttagArray = opt.removeTags ? [] : [starttag]; var endtagArray = opt.removeTags ? [] : [endtag]; diff --git a/src/transform/index.js b/src/transform/index.js index 484cba8..fe15401 100644 --- a/src/transform/index.js +++ b/src/transform/index.js @@ -4,7 +4,7 @@ var extname = require('../extname'); /** * Constants */ -var TARGET_TYPES = ['html', 'jade', 'slm', 'jsx', 'haml', 'less']; +var TARGET_TYPES = ['html', 'jade', 'slm', 'jsx', 'haml', 'less', 'twig']; var IMAGES = ['jpeg', 'jpg', 'png', 'gif']; var DEFAULT_TARGET = TARGET_TYPES[0]; @@ -140,6 +140,14 @@ transform.less.less = function(filepath){ transform.less.css = transform.less.less; +transform.twig.css = function (filepath) { + return ''; +}; + /** * Transformations for jsx is like html * but always with self closing tags, invalid jsx otherwise