News for hackers. Stuff that matters.
Re: Introducing WysiHat: An eventually better open source WY... by pstinnett on Tuesday October 21, 2008 @04:23PM (#339326)
Something I hope to see this implement: A function to strip any bad formatting/code that is generated when pasting text into a WYSIWYG editor. So much of my time is spent going through content and stripping bad code that was generated by Word/Outlook.
Re: Introducing WysiHat: An eventually better open source WY... by bobfunk on Wednesday October 22, 2008 @05:38AM (#339879)
At domestika.com we've been developing a javascript XHTML purifier, for this purpose. It's based on the algorithm for parsing html, specified in the HTML5 draft, so it's a lot more powerful than the typical regular expression based solutions.

For our use we're only interested in a very small subset of XHTML. We use a rich text editor to let clients edit the contents of their web sites, and we don't want any tags included that could disrupt the design of the page. So only the most basic markup is allowed.

Should be easy to extend the script to take into account more of the elements specified in the HTML 5 draft, if anybody wants a more permissive purification...

Best of all, we just open-sourced the script.

Grab it from Github: http://github.com/biilmann/javascript-xhtml-purifier

Original anouncement (in Spanish): http://domestika.org/foros/956-kode/hilos/73209-depuracion_d...

Re: Introducing WysiHat: An eventually better open source WY... by __FILE__ on Wednesday October 22, 2008 @01:22PM (#340269)
Is there any way to prevent pasting rich text? I can strip out the tag soup, but it would be great to have the option to only allow pasting plain text.
Re: Introducing WysiHat: An eventually better open source WY... by bobfunk on Wednesday October 22, 2008 @02:28PM (#340354)
Nopes - you have to cleanup the result of the paste.

As soon as you enable designmode on a document, every paste coming from something like Word will be transformed into delicious tag soup for you to deal with. No way to just disable that 'feature'.

Re: Introducing WysiHat: An eventually better open source WY... by jodrellblank on Tuesday October 21, 2008 @08:28PM (#339571)
Agreed. What you see is what you get is a lie of omission.

What you don't see is the horrible HTML generated behind the scenes cough Sharepoint WYSIWYG editor cough.

Re: Introducing WysiHat: An eventually better open source WY... by dmix on Tuesday October 21, 2008 @07:11PM (#339503)
Every time I hear something like that it sounds like a good idea, then I remember: internet explorer 6.

It would work on half the browsers and need a dirty hack for the rest.

Re: Introducing WysiHat: An eventually better open source WY... by maxwell on Tuesday October 21, 2008 @08:03PM (#339551)
37signals dropped IE6 support :)
Re: Introducing WysiHat: An eventually better open source WY... by johns on Wednesday October 22, 2008 @01:05AM (#339760)
The blog post says they're going to support it with WYSIHAT though.
Re: Introducing WysiHat: An eventually better open source WY... by maxwell on Thursday October 23, 2008 @10:52AM (#341208)
I don't see anything suggesting that...
Re: Introducing WysiHat: An eventually better open source WY... by qhoxie on Tuesday October 21, 2008 @04:42PM (#339351)
It does not seem to do this now, but the base seems flexible enough that it could in the future. Here's hoping.