first pass at meta tag construction abstraction (issue #116). Also addressed issue #118

This commit is contained in:
Julian Lam
2013-07-23 17:21:44 -04:00
parent 59029a0ef0
commit cc1cc7cae4
4 changed files with 35 additions and 14 deletions

View File

@@ -107,6 +107,23 @@
return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
});
},
buildMetaTags: function(tagsArr) {
var tags = '',
tag;
for(var x=0,numTags=tagsArr.length;x<numTags;x++) {
if (tags.length > 0) tags += "\n\t";
tag = '<meta';
for(y in tagsArr[x]) {
tag += ' ' + y + '="' + tagsArr[x][y] + '"';
}
tag += ' />';
tags += tag;
}
return tags;
}
}