htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
[plugin] Presenting HtmlTidy - server-side code cleaning


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Hipikat
User

Mar 4, 2004, 1:52 AM

Post #1 of 5 (1026 views)
Shortcut
[plugin] Presenting HtmlTidy - server-side code cleaning Can't Post

One of the largest complaints I've been getting since launching htmlArea as an option for TTW-WYSIWYG editing in my University has been the quality of the source-code produced... Especially in IE, where everything has been getting thrown into a single, completely illegible line.

Most of the javascript solutions I've found on this forum weren't really sufficient and I'm having problems with how much code the client is being thrown as it is, so I've created this plugin which queries the server with dirty code. The server runs it through HTML Tidy (http://tidy.sourceforge.net/) and voila, pretty, more compliant code.

Everything [I could think of] you need to know to install it is included in a README file in the attached archives, which are identical except for compression format.

I've also put a test htmlArea page up, which I really hope works for the outside world, you can try at http://sisyphus.uwa.edu.au/htmlarea/page.php.html. The HtmlTidy icon is, of course, in the top-right-hand corner of the toolbar.

Cheers =^.^=
Attachments: HtmlTidy.tgz (5.15 KB)
  HtmlTidy.zip (6.79 KB)


mishoo
User

Mar 4, 2004, 3:22 AM

Post #2 of 5 (1013 views)
Shortcut
Re: [Hipikat] [plugin] Presenting HtmlTidy - server-side code cleaning [In reply to] Can't Post

That's b.e.a.utiful! Cool

Can this be distributed under the same terms as HTMLArea itself? And if so, could you throw in an example file to go into /examples/ dir.?

Thanks Wink
--
Mihai Bazon,
dynarch.com
Applied Web Standards


nikotto
User

Mar 4, 2004, 8:31 AM

Post #3 of 5 (999 views)
Shortcut
Re: [Hipikat] [plugin] Presenting HtmlTidy - server-side code cleaning [In reply to] Can't Post

wow, great!
i love this feature!

wouldn't it be possible to do the cleaning onSubmit too?

mfg


Hipikat
User

Mar 4, 2004, 9:15 PM

Post #4 of 5 (977 views)
Shortcut
Re: [mishoo] [plugin] Presenting HtmlTidy - server-side code cleaning [In reply to] Can't Post

Yup - as with EnterParagraphs, it's free to the world with the minor crediting already in the files.

Same goes for InsertWords (http://www.interactivetools.com/forum/gforum.cgi?post=23402), although that's even more devoid of documentation and examples... Which I guess will either wait for me to find time (not likely in the near future), or some other kind soul to write it up? =)

But I'll try to do an example.html for this some time in the next week since it's particularly useful.

And yes, I guess it should be happening onSubmit - at least if Auto-Tidy is on. But this is just a first release :P Plus I want to make sure the default HTML Tidy configuration file is such that it's not going to do anything nasty to the appearance of code with it's filtering, before I make the filter automatic...

I think someone encountered lists getting double-spaced as a result of having HtmlTidy insert paragraphs around the individual elements, but I haven't been able to reproduce it? =O.o=


Hipikat
User

Mar 5, 2004, 2:51 AM

Post #5 of 5 (968 views)
Shortcut
Re: [nikotto] [plugin] Presenting HtmlTidy - server-side code cleaning [In reply to] Can't Post

More files. Basically as before... Possibly bug-fixes in the main code, but one big change to the patch to be applied over htmlarea.js...

I've added a try {} catch {} around the code setting bit of the setHTML function, which offers to let HtmlTidy attempt to fix the code if there's an error, and of course, if it's installed.

We were getting IE refusing to load content, throwing 'unknown error's *hugs MicroSoft* in some strange situations, like when code contained paragraphs, which were empty except for a line break. It's a result of a body element's innerHTML attribute refusing to parse stuff like that, and there are plenty of other people complaining about such things all over the internet...

So, if you too have a large, devolved organization where few people work out exactly where to report random problems to, or if you're sticking htmlArea in a product without magic error reporting built all over it, you'd best apply this patch =^.^=

As for onSubmit - I'm not sure about that right now. It's a good idea, and someone should implement it, but it would involve halting the onSubmit event, waiting for the post/reply, and then knowing to resume the submission...

Plus I (and I'm assuming others) use customized save functions. And there doesn't seem to be a direct 'submit' type of event. But I could just be guessing that.
Attachments: HtmlTidy02.tgz (5.69 KB)
  HtmlTidy02.zip (7.38 KB)

 
 
 


Search for (options)