Substring and html in the db


#1

Hey guys,

Ran into a snag today and was wondering if anyone can give me a hand. I
have
a blog type application that I’m developing. There is a page “list all
entries” which looks like this:

Title1
posted by Person1 about 2 hours ago
test1 test1test1 test1test1 test1test1 test1test1 test1test1 test1test1
test1… (click here for full post)

Title2
posted by Person1 about 2 hours ago
test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1 test1
test1 test1…(click here for full post)

I “preview” the news entries by displaying the first 200 characters of
the
body of each entry, with a …(click here for full post)
The problem is when I introduce HTML code into the body. If for example,
I
am in the middle of a hyperlink < a > tag when cutting off at the 200th
character, the HTML breaks the whole page.

Options: write some type of UBB thing, not allowing html and instead
stuff
like [link] and [img]

My question is, has anyone tackled this? DRY is the name of the game =)
Thank you very much,
Jin