Kouhei Sutou
null+****@clear*****
Tue Feb 18 00:04:18 JST 2014
Kouhei Sutou 2014-02-18 00:04:18 +0900 (Tue, 18 Feb 2014) New Revision: 09fae8f27fb938ce5c38516c4eee88fc2f799e1d https://github.com/ranguba/chupa-text-decomposer-html/commit/09fae8f27fb938ce5c38516c4eee88fc2f799e1d Message: Use Attributes Modified files: lib/chupa-text/decomposers/html.rb Modified: lib/chupa-text/decomposers/html.rb (+5 -2) =================================================================== --- lib/chupa-text/decomposers/html.rb 2014-02-18 00:02:53 +0900 (525f35e) +++ lib/chupa-text/decomposers/html.rb 2014-02-18 00:04:18 +0900 (1246b0b) @@ -43,10 +43,13 @@ module ChupaText end decomposed_data = TextData.new(body) decomposed_data.uri = data.uri + + attributes = decomposed_data.attributes title_element = (doc % "head/title") - decomposed_data["title"] = title_element.text if title_element + attributes.title = title_element.text if title_element encoding = doc.encoding - decomposed_data["encoding"] = encoding if encoding + attributes.encoding = encoding if encoding + yield(decomposed_data) end -------------- next part -------------- HTML����������������������������...Download