HTML bug - cleanup of italics needed July 25, 2006 8:51 AM   Subscribe

The unclosed italics in this comment makes all subsequent text in my 'My Comments' page to be in italics.
posted by slimepuppy to Bugs at 8:51 AM (18 comments total)

Everything below that comment in the 'My Comments' section is now shown in italics. Including the FPP links/topics on the left hand side.

Rocking firefox 1.5.0.4 on a PC. Sorry if this has been reported before.
posted by slimepuppy at 8:52 AM on July 25, 2006


It's bothering me too. (Also Firefox.)
posted by languagehat at 9:26 AM on July 25, 2006


IIRC the problem here is that the My Comments page lops off comments at some prefixed length [800 words? 800 characters? something]. If this happens in-between an open tag and a close tag then the open tag affects the rest of the post beneath it on the My Comments page. It's come up before in MeTa, I'm not sure if it happens enough for mathowie to code a fix for it.
posted by jessamyn (staff) at 9:28 AM on July 25, 2006


It's not actually unclosed in the comment—mefi seems to add closing tags at the end of a comment block if any are left open. So while it appears leapingsheap meant to close an <em> tag after that first italic paragraph but goofed and put another opening <em> instead, you can see a </em></em> pair at the end of the comment. (view source, natch)

However, My Comments only shows the first n-characters of a comment (or something like that—is it 1024 chars?), so if a tag opens within the quoted portion but is not closed, the tag remains open for the rest of My Comments.

It's a pain, and a known issue, and may or may not be kind of a bitch to fix—Matt could check each sub-quoted comment rendered on My Comments and apply the auto-closing logic that works in the posts themselves, I guess. Doing that in real time would be sort of crappy, though, so it'd make more sense to check a comment for length at post time, and if it is big enough to see sub-quoting, cache a My Comments version and apply the the logic to that.
posted by cortex at 9:28 AM on July 25, 2006


And, uh, what she said.

It's also a problem with large blocks of quoted <small> text.
posted by cortex at 9:29 AM on July 25, 2006


I did close the open </em> tag also, what a pain in the ass. Preview, people!
posted by jessamyn (staff) at 9:32 AM on July 25, 2006


Cool. Now can you kill that hard line break in the quoted sentence? It looks terrible.
posted by cortex at 9:34 AM on July 25, 2006


Also, there's a lot of dishes on the counter, I notice.

Is that the oatmeal from Saturday?
posted by cortex at 9:35 AM on July 25, 2006


Uh, that's not oatmeal.
posted by Alvy Ampersand at 9:39 AM on July 25, 2006


fer chrissakes, can't anyone clean up around here? the party was LAST WEEK!
posted by casconed at 9:59 AM on July 25, 2006


Meetup in the server room!
posted by blue_beetle at 10:21 AM on July 25, 2006


It's actually pretty rare when stuff like this happens. Since it used to randomly happen every few days I changed the code to instead of just grabbing 4000 characters of a comment, it now grabs 5000 characters and then strips all HTML out of that, then displays 4000 characters of that just in case some stray HTML wound up being left behind in the data.

I think this one comment borked because it has numerous italics opening and closing and it's humongous.
posted by mathowie (staff) at 10:30 AM on July 25, 2006


...it now grabs 5000 characters and then strips all HTML out of that, then displays 4000 characters of that just in case some stray HTML wound up being left behind in the data.

Sounds like you need a better stripper.
posted by grateful at 10:36 AM on July 25, 2006


Yeah, comments shown on the My Comments page are most definitely not free of HTML.
posted by cortex at 10:39 AM on July 25, 2006


Here's one that will preserve spacing you can use whenever you get around to porting metafilter to perl:
s/(\s)?< [a-z\/].*?>(?(1)\s|)?/(defined $1) ? qq{ } : qq{}/xmsegi;
posted by moift at 10:53 AM on July 25, 2006


"Sounds like you need a better stripper."

On the internet, in real life, we all could use a better stripper.
posted by klangklangston at 11:38 AM on July 25, 2006


Couldn't you just wrap each item in a div?
posted by baylink at 9:14 PM on July 25, 2006


Logically enough, closing the tags in a following comment works, but what kind of sick, anal, obsessive-compulsive person would want to run around commenting just to keep their My Comments page tidy?

Uh, bbl...
posted by Alvy Ampersand at 8:41 AM on July 26, 2006


« Older Take my survey; I don't think so!   |   Forgot to close a link in this thread. Newer »

You are not logged in, either login or create an account to post comments