File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def self.parse_shared_string_from_document(xml)
2929 dictionary = Hash . new
3030
3131 xml . css ( 'si' ) . each_with_index do |si , idx |
32- text_nodes = si . css ( 't' )
32+ text_nodes = si . css ( '>t, r t' )
3333 if text_nodes . count == 1 # plain text node
3434 dictionary [ idx ] = Creek ::Styles ::Converter . unescape_string ( text_nodes . first . content )
3535 else # rich text nodes with text fragments
Original file line number Diff line number Diff line change 7878 <si >
7979 <t >Cell with_x000D_escaped_x000D_characters</t >
8080 </si >
81+ <si >
82+ <t >吉田兼好</t >
83+ <rPh sb =" 0" eb =" 2" >
84+ <t xml : space =" preserve" >ヨシダ </t >
85+ </rPh >
86+ <rPh sb =" 2" eb =" 4" >
87+ <t xml : space =" preserve" >ケンコウ </t >
88+ </rPh >
89+ <phoneticPr fontId =" 1" />
90+ </si >
8191</sst >
Original file line number Diff line number Diff line change 77 doc = Nokogiri ::XML ( shared_strings_xml_file )
88 dictionary = Creek ::SharedStrings . parse_shared_string_from_document ( doc )
99
10- expect ( dictionary . keys . size ) . to eq ( 6 )
10+ expect ( dictionary . keys . size ) . to eq ( 7 )
1111 expect ( dictionary [ 0 ] ) . to eq ( 'Cell A1' )
1212 expect ( dictionary [ 1 ] ) . to eq ( 'Cell B1' )
1313 expect ( dictionary [ 2 ] ) . to eq ( 'My Cell' )
1414 expect ( dictionary [ 3 ] ) . to eq ( 'Cell A2' )
1515 expect ( dictionary [ 4 ] ) . to eq ( 'Cell B2' )
1616 expect ( dictionary [ 5 ] ) . to eq ( "Cell with\r escaped\r characters" )
17+ expect ( dictionary [ 6 ] ) . to eq ( '吉田兼好' )
1718 end
1819
1920end
You can’t perform that action at this time.
0 commit comments