[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: hpricot question

John Joyce

7/19/2007 12:30:00 PM


On Jul 19, 2007, at 1:32 AM, Ivor Paul wrote:

> I'm a total hpricot newbie, so this is only out of curiousity...
>
> Is the following expected behaviour?
> I found this while struggling through a nasty xml parsing bug.
>
> hstr = Hpricot('<a/><b>c</b>').to_s #or to_html
>
> returns => '<a><b>c</b></a>'
>
> I have found that using to_original_html returns '<a/><b>c</b>' as
> expected
> but I was wondering why you would want <a/> to wrap the other
> contents when
> it obviously isn't correct? Is this handy behaviour for scrapping?
>
>
> regards
Hmm... if you want modern markup, it is correct.
<a href="some_uri" title="some_title">Link's text here</a>
You'd do well to avoid <b></b> in favor of <strong></strong>