mirror of
https://github.com/KevinMidboe/inline-html.git
synced 2025-10-29 17:40:29 +00:00
Fix bug where template expressions were interpreted as paths.
This commit is contained in:
14
lib/is-template-expression.js
Normal file
14
lib/is-template-expression.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Tests whether a path is a mustache template expression.
|
||||
*
|
||||
* Note: would be best if this was file extension specific
|
||||
* (i.e. *.hbs => test for `{{ }}` )
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {Boolean}
|
||||
*/
|
||||
var isTemplateExpression = function (path) {
|
||||
return /^{{.*}}$/.test(path);
|
||||
};
|
||||
|
||||
module.exports = isTemplateExpression;
|
||||
Reference in New Issue
Block a user