Changeset 1133
- Timestamp:
- 12/25/07 02:32:22 (1 year ago)
- Files:
-
- trunk/lib/merb/core_ext/hash.rb (modified) (1 diff)
- trunk/spec/merb/core_ext_spec.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/merb/core_ext/hash.rb
r1117 r1133 285 285 stack.last.add_node(temp) 286 286 end 287 when :text 287 when :text, :cdata 288 288 stack.last.add_node(event[1]) unless event[1].strip.length == 0 289 289 end trunk/spec/merb/core_ext_spec.rb
r1085 r1133 224 224 xml = "<tag>This is the contents</tag>" 225 225 Hash.from_xml( xml ).should == { 'tag' => 'This is the contents' } 226 end 227 228 it "should work with cdata tags" do 229 xml = <<-END 230 <tag> 231 <![CDATA[ 232 text inside cdata 233 ]]> 234 </tag> 235 END 236 Hash.from_xml(xml)["tag"].strip.should == "text inside cdata" 226 237 end 227 238
