[Groonga-commit] ranguba/chupa-text-decomposer-html at 24afeaf [master] Copy only attributes

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Feb 18 01:04:13 JST 2017


Kouhei Sutou	2017-02-18 01:04:13 +0900 (Sat, 18 Feb 2017)

  New Revision: 24afeaf18f73ab253b7732429f3fe525d0e217ed
  https://github.com/ranguba/chupa-text-decomposer-html/commit/24afeaf18f73ab253b7732429f3fe525d0e217ed

  Message:
    Copy only attributes

  Modified files:
    lib/chupa-text/decomposers/html.rb

  Modified: lib/chupa-text/decomposers/html.rb (+5 -4)
===================================================================
--- lib/chupa-text/decomposers/html.rb    2017-02-18 00:54:16 +0900 (1ee37a5)
+++ lib/chupa-text/decomposers/html.rb    2017-02-18 01:04:13 +0900 (7f456f6)
@@ -41,10 +41,11 @@ module ChupaText
         else
           body = ""
         end
-        decomposed_data = data.dup
-        decomposed_data.body = body
-        decomposed_data.size = body.bytesize
-        decomposed_data.mime_type = "text/plain"
+        decomposed_data = TextData.new(body)
+        decomposed_data.uri = data.uri
+        data.attributes.each do |name, value|
+          decomposed_data[name] = value
+        end
 
         attributes = decomposed_data.attributes
         title_element = (doc % "head/title")
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index