Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 587e1828a05068c335fe8967d2ca9e5aa350252b 1 parent 9669002
@alecperkins alecperkins authored
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(" "));
Please sign in to comment.
Something went wrong with that request. Please try again.