rubys-gorp 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/gorp.gemspec +1 -1
- data/lib/gorp.rb +11 -0
- data/lib/version.rb +1 -1
- metadata +1 -1
data/gorp.gemspec
CHANGED
data/lib/gorp.rb
CHANGED
@@ -223,6 +223,17 @@ rescue LoadError
|
|
223
223
|
require 'rexml/document'
|
224
224
|
|
225
225
|
def xhtmlparse(text)
|
226
|
+
begin
|
227
|
+
require 'htmlentities'
|
228
|
+
text.gsub! '&', '&'
|
229
|
+
text.gsub! '<', '&lt;'
|
230
|
+
text.gsub! '>', '&gt;'
|
231
|
+
text.gsub! ''', '&apos;'
|
232
|
+
text.gsub! '"', '&quot;'
|
233
|
+
text.force_encoding('utf-8') if text.respond_to? :force_encoding
|
234
|
+
text = HTMLEntities.new.decode(text)
|
235
|
+
rescue LoadError
|
236
|
+
end
|
226
237
|
REXML::Document.new(text)
|
227
238
|
end
|
228
239
|
|
data/lib/version.rb
CHANGED