[jQuery] Re: html to text

2009-03-26 Thread bart

I have a HTML document with some hardcoded content in it. This content
needs to be moved to a database so I have jQuery helping me with some
html manipulation left and right to batch some queries. As I want to
insert valid xhtml into the database  won't do. But I understand
that how these self closing tags are handled in browser specific? It
would make more sense to me if the browser would just handle HTML
syntax according to the specified doctype...

On Mar 26, 4:33 pm, Martijn Houtman  wrote:
> On Mar 26, 2009, at 4:19 PM, bart wrote:
>
> > For each match it creates a div which holds the HTML in text format. I
> > noticed that it transformed a line break  to  (without the
> > slash) what causes this behavior? Does this only happen with self
> > closing tags? Can I prevent it all together?
>
> I believe XHTML is the only version that enforces a break element to  
> be self-closed. The rest accept (or even define) , rather than  
> . Browsers (luckily?) are very forgiving, so they rewrite   > to  internally. That is probably why you get them back like that.
>
> Exactly why would you want to prevent the browser from rewriting it?
>
> Regards,
> --
> Martijn.


[jQuery] Re: html to text

2009-03-26 Thread Martijn Houtman


On Mar 26, 2009, at 4:19 PM, bart wrote:


For each match it creates a div which holds the HTML in text format. I
noticed that it transformed a line break  to  (without the
slash) what causes this behavior? Does this only happen with self
closing tags? Can I prevent it all together?


I believe XHTML is the only version that enforces a break element to  
be self-closed. The rest accept (or even define) , rather than  
. Browsers (luckily?) are very forgiving, so they rewrite > to  internally. That is probably why you get them back like that.


Exactly why would you want to prevent the browser from rewriting it?

Regards,
--
Martijn.