Bullets Messed Up Formatting March 6, 2003 3:28 PM   Subscribe

matt, could use something like tidy rather than a hand-rolled html-cleaning routine? i don't know how easy it is to spawn a process from cf, or what the xml handling is like, so this is just on the wild off-chance (you'd need to stick the fragment inside a valid document body, push it through tidy and then extract the fragment, i think). it might be fun to program, but maybe a whole day's work.
posted by andrew cooke at 3:42 PM on March 6, 2003

Tidy comes in both Perl and Java flavours now. So that could be integrated into MeFi.
posted by riffola at 3:55 PM on March 6, 2003

Guns don't kill threads, bullets kill threads.
posted by mr_crash_davis at 4:42 PM on March 6, 2003

Oops--that's about as broken as they get. IE, at least, buys the farm when it sees all those improperly nested </li> tags. Who knew? Avoiding that kind of HTML-ocaust would require something a little meatier than a few regular expressions.

On preview: mr_crash_davis makes make laugh out loud for the hundredth time.
posted by vraxoin at 5:11 PM on March 6, 2003

Somebody edumicate me -- the lies are nested, but they all terminate. Why the hiccup?
posted by eddydamascene at 5:32 PM on March 6, 2003

The list had bizarre HTML but it looks like it was the closing DIV tag (after "E V E R H E A R D O F H E R") that did it.

(It took me about 8 months to realise that regular expressions wouldn't ever catch this kind of thing... geez I'm thick)
posted by holloway at 5:51 PM on March 6, 2003

eddy - an <li> cannot contain another <li> directly - each <li> must be inside a <ul> (or similar). so it should go
so it's badly formed (x)html. that doesn't explain why the browser is confused, but it does mean that it's within it's rights to be so.
or, perhaps more likely, the browser has decided it's looking at html (not xhtml) (which doesn't require </li>'s) and so is "surprised" to suddenly find a bunch of tags closing something.
(hey, preview doesn't lose entities! thanks!) (but &nbsp;'s disappear...)
posted by andrew cooke at 6:11 PM on March 6, 2003

oops "its" (last occurence) dammit
posted by andrew cooke at 6:13 PM on March 6, 2003

Thanks, I was wondering about the necessity of the closing tags, also.
posted by eddydamascene at 6:25 PM on March 6, 2003

It's not missing </li>'s; it's an extra </div>.
posted by timeistight at 7:44 PM on March 6, 2003

Guns don't kill threads, bullets kill threads.

OK, so it turns out to be false. But hilarious.
posted by soyjoy at 9:21 PM on March 6, 2003

yeah, sorry (those li's are still wrong but timeistight's spotted why the browser's upset). and what's a <nobr>?
posted by andrew cooke at 3:17 AM on March 7, 2003

Anything wrapped in it will not break. Ignoring the irony of that, let me restate: nothing inside the tags will wrap. Put that on the banned tag list.
posted by yerfatma at 4:53 AM on March 7, 2003

Sorry, kids. I was so busy making Metafilter display a McSweeney's style headline I didn't see what it was trying to do with the other tags.

I think I "effed up" in two ways:
  • I either left off the opening <div> tag or it was eaten by Metafilter, causing the closing </div> tag to close one of the page's own sections prematurely.
  • I didn't close each list item with a </li> tag, which caused Metafilter to close them for me in an invalid way.
As I hope this post will demonstrate, though, lists don't kill Metafilter; assblankets do.
posted by rcade at 6:46 AM on March 7, 2003

I found the problem: Metafilter removes <div> tags before a comment is posted, but it does not remove </div> tags. So anyone who tries to define a section of a comment with <div> and </div> will break the formatting for the rest of the page.
posted by rcade at 6:52 AM on March 7, 2003

I fail to understand why people feel the need to do fancy formatting when they post here. It routinely breaks the HTML and we all have to suffer the bollixed threads. Can't you say what you want to say using ital, bold, and the occasional paragraph break? Save your leet formatting skillz for your own blogs. [/grumpy old coot]
[note clever use of square brackets so there's no possibility of screwing things up]
posted by languagehat at 8:17 AM on March 7, 2003

MetaFilter: the lies are nested
posted by me3dia at 8:32 AM on March 7, 2003

...and unterminated.
posted by timeistight at 8:54 AM on March 7, 2003

No languagehat, you need blockquote for longer pieces of quoted text. And bulleted or ordered lists are helpful for some things too. I didn't know you needed to close the list items though. I'll have to remember that.
posted by willnot at 1:53 PM on March 7, 2003

Didn't someone way back suggest that the preview screen automatically posted a sample comment after yours, to see if your tags were going to screw up the rest of the thread? What was the verdict on that? Sounded like a good idea to me.
posted by Hildago at 2:28 PM on March 7, 2003

... that the preview screen automatically post...
posted by Hildago at 2:30 PM on March 7, 2003

I get all syntax-paranoid when I know there's a linguist in the thread.
posted by Hildago at 2:31 PM on March 7, 2003

  • You
  • don't
  • need
  • to
  • close
  • list
  • items
posted by timeistight at 2:46 PM on March 7, 2003

Your code, after mefi has fun with it, timeistight. Subbed with [ and ] for MefiProtection (tm).


BTW, the html verifies as invalid.

This page is not Valid HTML 4.0 Transitional!

Total: 17 errors.

So there. :-P

Not that I think this is shameful, Matt's done a much better job than slashdot, which blocks the verifier, since it produces about 100 errors. Hehehe...
posted by shepd at 7:48 PM on March 8, 2003

I thought we were talking about what broke the page, not about code validity. Nonetheless, the code as I wrote it is valid.
posted by timeistight at 10:02 AM on March 9, 2003

« Older New NYC meetup thread.   |   SXSW! Who's here already? Who will be? Newer »

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