- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Okay, so they're able to use Regex but at the same time not.
And since when are tags like "" and attributes like "class" subject to removal? <font> and deprecated stuff I can understand...
Admin
Are you sure this 'CMS' isn't Community Server?
Admin
They didn't write their own reg-ex language. Much less their own reg-ex processor. At this rate they'll never develop their own in-house, proprietary mark-up language. Color me unimpressed.
Admin
I believe in this case it stands for "Clearly Must Stop"
Admin
I'm pretty sure I would have strangled the writer of this before I hit the "span".
Admin
My intro CS class totally taught this way of HTML clean-up.
Admin
The first thing I noticed is that <script> is totally fine to have with this cleaner.
Admin
The hell? That won't clean HTML, it will break it.
Admin
I like the way it removes all the tag attributes first, thereby making the job of removing the actual tag a whole lot harder. But that's no problem, we'll just do a search and replace on "
Admin
The fastest most dependable way to clean html from a string/file is to use SAX and only forward the characters events.
Admin
"Naturally, their wheels aren't perfectly circular... and often times, they won't even fit into the most liberal definition of "round"."
Woah... they're not circular AND not round? What are the odds?
Admin
Clearly they've missed a few:
Admin
The Daily WTF- Curious Perversions of Written English
Admin
I think I can clean the HTML better than this...
Admin
There's nothing wrong with that sentence. It's like saying "She wasn't beautiful, and often she was worse than ugly". It's saying they're not circular, and sometimes they're not even round. What's weird about that?
Admin
Wasn't perl created for doing stuff like this?
Admin
Slowly put the Regex class on the ground and step away with your hands above your head.
Admin
if (!(html.Contains(" >") || html.Contains(" >")))
I like it when code looks like 1 || 1. Maybe they thought the first html.Contains(" >") wasn't enough to find those pesky " >".
Admin
I apologize... I, I just couldn't help myself.
if (!(html.Contains(comment) || html.COntains(comment))) out << "I'm Frist!";
Admin
Admin
TRWTF is that there is no object model for HTML documents. I think I will write one and call it XMLDOM.
Admin
Admin
So... conic sections like hyperbolas, parabolas, and elipses aren't rounded? I'm like 80% sure they aren't circular.
Admin
I'm assuming you are an idiot, in the most polite sense.
http://www.w3schools.com/HTMLDOM/dom_intro.asp
Or maybe you are completely aware of this, and were funny or sarcastic, and I missed it.
Either way... I still think you are am idiot.
Admin
Stick to your day job.
Admin
You have got rid of everything! The correct way is to apply a xsl based template to get rid of the HTML tags.
Admin
I totally get this code. A few weirdnesses but a marginal WTF.
I would have thought that behind this all, there was a "paste from Word into rich text editor" problem, but there's no smart-quote fixing.... Is it catching those notorious unquoted attributes that Word likes to throw into html?
I used this in conjunction with ckeditor once:
because Word pops a big ugly stylesheet into the first
element, and then I had to go and substitute html entities for all the Windows-encoded crap characters. Ugh.
Admin
He's mostly a troll.
Admin
Admin
I was expecting something along the lines of,
Admin
How about those ladies in Rubens paintings? wink wink
Admin
Mmmmkay. Such inspiring advice! I must assume you are in a profession that permits such life guiding instruction. Your five word sentence clearly dictates that. Are you a psychiatrist or a psychologist? No wait. You must be an underpaid public school guidance councillor. No, I got it, you are a janitor, who left their 6 figure Wall Street career because you though the streets were dirty. Either that, you might just be some piece of nearly congealed flesh that managed to string together a few words that have no meaning or correlation to anything I said.
Whatever you do, please keep your day job as well, because I wouldn't want to meet you in public after you climbed out of your cardboard box or dumpster or whatever hobble you live in.
Admin
Admin
Admin
Cool story.
Admin
Admin
Admin
Admin
Or do you no longer care about maintaining anonymity?
Admin
Admin
Admin
This is the first time you realized that I am a smart guy. Keep up the good work!
Admin
Now you're confusing Arabs with Indians. What's next?
Admin
...and print the SAX parse exceptions traceback!
Admin
Admin
Hey! This code was developed in my company!
And of course that is the best approach to do it. We had a close deadline, get it? In fact, one thing that i recommended to speed up the process is to stop using open source projects and start developing in-house libraries we could use.
That way we managed to keep the development time down to Six Weeks!
Admin
Getting high is a means of escape. All of this is just instant gratification. Do not believe in instant gratification. It is bad for your soul.
Admin
I think TRWTF is that while/if/break structure towards the end.
Admin
an imperfect circle could still be considered round.
Admin
I don't think there's a problem....