Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _escape(text)
- text.gsub(/[^-\w\d\/\n\r _:;+=.\@*,()#]/) do |x|
- case x
- when '"' : '"'
- when '\'' : '''
- when '<' : '<'
- when '>' : '>'
- when '&' : '&'
- else
- #"&##{x[0]};" # this seemed to cause weird chars
- x
- end
- end
- end
Add Comment
Please, Sign In to add comment