Skip to content

Commit

Permalink
added template.escape()
Browse files Browse the repository at this point in the history
  • Loading branch information
der-On committed Aug 12, 2014
1 parent 60c81ec commit 592012d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 13 additions & 1 deletion lib/template.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var fs = require('fs');
var path = require('path')
, utils = require('utilities')
, geddyPath = path.normalize(path.join(require.resolve('geddy'), '../../'));

var engineToExt = {
Expand Down Expand Up @@ -249,4 +250,15 @@ function escaped(content, engine)
return '<!-- ' + content + ' -->';
}
}
module.exports.escaped = escaped;
module.exports.escaped = escaped;

/**
* Escapes a string
* @param str {String}
* @return {String}
*/
function escape(str)
{
return utils.string.escapeXML(str.replace(/;\S*/, ''));
}
module.exports.escape = escape;
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geddy-genutils",
"version": "0.0.9",
"version": "0.0.10",
"description": "General purpose utilities for geddy generators.",
"main": "index.js",
"scripts": {
Expand All @@ -18,5 +18,8 @@
"bugs": {
"url": "https://github.com/geddy/geddy-genutils/issues"
},
"homepage": "https://github.com/geddy/geddy-genutils"
"homepage": "https://github.com/geddy/geddy-genutils",
"dependencies": {
"utilities": "*"
}
}

0 comments on commit 592012d

Please sign in to comment.