Hi,
I''ve started looking at ticket
90<http://merb.devjavu.com/projects/merb/ticket/90>and there are a
couple of situations that the current implementation doesn''t
cater for.
1. Tag Attributes are wiped out.
- <tag1 attr1=''1''>Content</tag1> #=> {
"tag1" => "Content" }
- I think it should return
- {"tag1" => { "attr1" => ''1'',
"__content__" => "Content" }
2. Mixed content can throw an error or get clobbered
- <tag1>Content <em>is</em> Clobbered</tag1>
#=> Raises a
Private error called on array gsub
- <tag1>Content <em>is</em></tag1> #=>
Clobbered. Returns
{"tag1"=>"Content "}
- Feels like it should return
- {"tag1"=>"Content
<em>is</em>Clobbered" }
Is the current behaviour what is required or should these inconsitencies be
fixed?
Cheers
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/merb-devel/attachments/20070718/2a033ac5/attachment.html
On 7/18/07, Daniel N <has.sox at gmail.com> wrote:> > Hi, > > I''ve started looking at ticket 90<http://merb.devjavu.com/projects/merb/ticket/90>and there are a couple of situations that the current implementation doesn''t > cater for. > > > 1. Tag Attributes are wiped out. > - <tag1 attr1=''1''>Content</tag1> #=> { "tag1" => "Content" } > - I think it should return > - {"tag1" => { "attr1" => ''1'', "__content__" => "Content" } > >Seems I was a bit hasty with my conclusion on this one. I still don''t think it is correct though. <tag1 attr=''1''><strong>Content</strong></tag1> results in {"tag1"=>{"strong"=>"Content", "attr"=>"1"}} So it seems that you can only have attributes in an element that does not have a child text element. I also tried this <tag1 attr=''1''><strong>Content</strong>Mixed Content</tag1> and got {"tag1"=>"Mixed Content"} Just to confirm. Any thoughts on what it should be? Cheers Daniel> 1. Mixed content can throw an error or get clobbered > - <tag1>Content <em>is</em> Clobbered</tag1> #=> Raises a > Private error called on array gsub > - <tag1>Content <em>is</em></tag1> #=> Clobbered. Returns > {"tag1"=>"Content "} > - Feels like it should return > - {"tag1"=>"Content <em>is</em>Clobbered" } > > > Is the current behaviour what is required or should these inconsitencies > be fixed? > > Cheers > Daniel > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070718/6507da5b/attachment-0001.html
On 7/18/07, Daniel N <has.sox at gmail.com> wrote:> > Hi, > > I''ve started looking at ticket 90<http://merb.devjavu.com/projects/merb/ticket/90>and there are a couple of situations that the current implementation doesn''t > cater for. > > > 1. Tag Attributes are wiped out. > - <tag1 attr1=''1''>Content</tag1> #=> { "tag1" => "Content" } > - I think it should return > - {"tag1" => { "attr1" => ''1'', "__content__" => "Content" } > 2. Mixed content can throw an error or get clobbered > - <tag1>Content <em>is</em> Clobbered</tag1> #=> Raises a > Private error called on array gsub > - <tag1>Content <em>is</em></tag1> #=> Clobbered. Returns > {"tag1"=>"Content "} > - Feels like it should return > - {"tag1"=>"Content <em>is</em>Clobbered" } > >Perhaps <tag1>Content <em>is</em> Clobbered</tag1> should return { "tag1" => "Content <em>is</em> Clobbered" } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/merb-devel/attachments/20070718/44323236/attachment.html