diff --git a/jquery.lettering.js b/jquery.lettering.js
index 8a693c8..f21f4da 100644
--- a/jquery.lettering.js
+++ b/jquery.lettering.js
@@ -11,16 +11,20 @@
* Date: Mon Sep 20 17:14:00 2010 -0600
*/
(function($){
+
function injector(t, splitter, klass, after) {
var a = t.text().split(splitter), inject = '';
if (a.length) {
$(a).each(function(i, item) {
- inject += ''+item+''+after;
+ escitem = escape(item);
+ inject += ''+item+''+after;
});
t.empty().append(inject);
}
}
-
+ function escape(str) {
+ return String(str).replace(/&/g, '&').replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); // avoids double encoding & See comments from http://css-tricks.com/snippets/javascript/htmlentities-for-javascript/
+ }
var methods = {
init : function() {