html-helper.js 541 B

12345678
  1. $(function(a){
  2. a.htmlEncode=function(b){
  3. return b.replace(/&/g,"&")
  4. .replace(/ /g," ")
  5. .replace(/</g,"&lt;")
  6. .replace(/>/g,"&gt;")
  7. .replace(/\n/g,"<br />")
  8. .replace(/"/g,"&quot;").replace(/'/g,"&#39;")};a.htmlDecode=function(b){return b.replace(/&#39;/g,"'").replace(/<[Bb][Rr]\s*(\/)?\s*>/g,"\n").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")};a.htmlFilter=function(b){return b==null?"":b.replace(/<\s*\/?[^>]*\s*>/g,"").replace(/"/g,"")}}(jQuery));