Browse files

Wrap all ampersands in span.amp.

`"&"`, instead of `/&/g`, only matches the first ampersand, because JavaScript is weird like that.
  • Loading branch information...
1 parent 9669002 commit 587e1828a05068c335fe8967d2ca9e5aa350252b @alecperkins alecperkins committed Sep 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 js/jquery.slabtext.js
View
2 js/jquery.slabtext.js
@@ -138,7 +138,7 @@
finalText = postText;
};
- lineText.push('<span class="slabtext">' + $.trim(settings.wrapAmpersand ? finalText.replace("&", '<span class="amp">&amp;</span>') : finalText) + "</span>");
+ lineText.push('<span class="slabtext">' + $.trim(settings.wrapAmpersand ? finalText.replace(/&/g, '<span class="amp">&amp;</span>') : finalText) + "</span>");
};
$this.html(lineText.join(" "));

0 comments on commit 587e182

Please sign in to comment.