How about stripping tags and showing 30 characters of unformatted text?
It's quite a common thing to do for displaying summaries and would solve the
problem instead of just fixing the symptoms.

--rob


On 7/19/07, Shawn Tumey <[EMAIL PROTECTED]> wrote:

If the the content is being fetched using AJAX and the return type is text
that you are using to plop in as the inner-html for the div, than you should
be able to parse through the text  and push elements onto a stack when
opening tags are encountered. Pop when closing tags are encountered. Any
tags on the stack at the end of the input need closed.

-Shawn

On 7/19/07, Jonathan Sharp <[EMAIL PROTECTED]> wrote:
>
> I think you're going to have to attack that server side as the html is
> interperted browserside into the dom tree which automatically closes tags as
> necessairy.
>
> -js
>
>
> On 7/19/07, sozzi <[EMAIL PROTECTED] > wrote:
> >
> >
> > I have a rather odd problem where I am looking for potentially missing
> > html tags due to truncation and need to close them.
> >
> > I am displaying a short summaries for an overview of published
> > articles by showing a title and the first 30 words. Unfortunately
> > sometimes the article starts with an OL or UL and the closing tags get
> > truncated.
> >
> > Is there a way to find missing closing tags within a div and close
> > them automatically? I don't need a final solution, any hint where to
> > start would be great, preferably client-side (jQuery) until I get it
> > sorted on the server-side....
> >
> > Thanks
> >
> >
>





--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
"There's a whale there's a whale there's a whale fish" he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.

Reply via email to