Html Remover/Cleaning Script

 

Free Ruby Scripts Home

This script is useful for removing pesky back and forward errors, perfect for people making blogs or comment systems. Also, \n's are converted to XXnXX for your convenience in storing them, and can easily be converted back when needed. Remove the spaces and fix the ()'s. This allows people to still use bold and italic test, and br line breaks.

mystring = mystring.gsub(/(backslash)(backarrow)/, "& #60;").gsub(/(backslash)(forwardarrow)/,"& #62;").gsub(/(backslash)n/,"XXnXX")

mystring = mystring.gsub(/& #60;br& #62;/,"(forwardarrow)br(backarrow)")

mystring = mystring.gsub(/& #60;b& #62;/,"(forwardarrow)b(backarrow)").gsub(/& #60;\(backslash)b& #62;/,'(forwardarrow)/b(backarrow)')

mystring = mystring.gsub(/& #60;i& #62;/,"(forwardarrow)i(backarrow)").gsub(/& #60;\(backslash)i& #62;/,'(forwardarrow)/i(backarrow)')