ID:133243
 
Would it be possible to forcibly end the hub info's HTML? Countless hubs that attempt to use tables don't end their tags properly, and it screws up the entire hub page for that game. It's easy to see how this could happen since the input box takes text, both, at its face value, and it interprets HTML; forcing you to leave off any formatting that would make the tags easy to mod.
If the creator of a hub wants to break their page, why stop them? It's their loss.
In response to Slurm
Slurm wrote:
If the creator of a hub wants to break their page, why stop them? It's their loss.

A. Its not 100% their fault since the info's input box is mildly retarded
B. It makes BYOND look bad as a whole if half the hub entries look like they got mutated in some horrible experiment
C. Its attitudes like that that lead BYOND's community into such a gutter
Fixing malformed hub entry HTML is high on my wish list, but scrubbing bad HTML is not a trivial problem. I have yet to run across a library for doing this that I consider satisfactory, and it's a royal pain in the butt to write one. Any suggestions as to how to accomplish this are welcome.

Lummox JR
In response to Lummox JR
Since tables are the only problem I know of:
Write a text parser that automatically inserts </td> and </tr> if a new one is started before the previous one is ended. Add multiple </table> tags at the very end to match any unmatched ones.

EDIT: Also, I've suggested this before, but a radio button on the input that allowed us to select Text/HTML/Both(Default) wouldn't hurt.
In response to Lummox JR
In response to Slurm
I've looked over Tidy before and it seems deficient. It's not forgiving of some common methods of handling HTML that users have on the BYOND site. I think what'd be best would be something that expects crappy input and turns it into decent formatting.

I wrote something like this in Perl six years ago as a Movable Type plugin (Bloxpert), but it was way more limited than what we would need. Also, it's incredibly complex and impossible to maintain, so it's not like I'd be able to just modify that for our needs. However a lot of what it does, I would like to do also: It inserts proper <p> tags around paragraphs, handles blockquotes and other blocks correctly by not trying to paragraphize them, and deals with some unclosed tags. I'd ideally like something like that.

Lummox JR
In response to Lummox JR
'cleaning' up html isn't really needed, some browsers fix errors html and such errors themselves, Google Chrome does so, and I believe I've seen a plugin for FireFox for it.
In response to Super Saiyan X
Chrome is still a considerable minority browser, and not everyone has that Firefox plugin. You're also forgetting about other browsers that don't clean up HTML, which would seem to be the majority, in both users and just number of browsers. Such a program would be very useful.
In response to Super Saiyan X
The core problem though is that while browsers can clean up rogue HTML in a whole document, they can't do it in just part of a document. The idea would be to sterilize HTML in just part of the page so it doesn't screw up the rest of the layout.

Lummox JR
In response to Lummox JR
Can't you just keep a copy of the original input, and just display tidy'd output?

Tidy has loads of options either way, perhaps it could be tweaked to your requirements.
In response to Lummox JR
What language would you need it written in to work with the input from the website?