Cleaning Up Posts

Most sites that allow HTML have some sort of sanitizer in place, so that when someone forgets to close a tag in a post, they can’t screw up formatting for the rest of the page. They tend to restrict what you can post to a reasonable set of tags, so that you can’t, for example, embed an iframe with Javascript to expand it to 100% width and height, as spammers have done in the past.

It’s very tempting for me to write a few filters though:

  • If the entire post is bold, remove the tags. Posting your reply in bold in the middle of a discussion is really pretty obnoxious. (As a passive-aggressive person, it’s tempting to replace <b> with <small> if they encompass the whole post.)
  • If the post is more than 8 characters and is entirely in uppercase, downcase the entire thing. It amazes me how many people just write in all caps as if it’s normal.
  • If a post is more than 50 characters and is entirely in lowercase, sentence-case it. This assumes that they used punctuation at all while disregarding capitalization, though.

I forget where it was, maybe Yahoo, but they have a little bit of JavaScript that displays a netiquette ‘warning’ if it sees you typing in all caps. That should be a standard feature.

Leave a Reply

Your email address will not be published. Required fields are marked *