> > On Mon, Apr 11, 2011 at 5:28 AM, John M. Dlugosz > <[email protected]>wrote: > >> I have a form where an admin can change a part of the content on a page. >> The form lets someone do it without having to update the files on the >> server in a more traditional manner; BUT, it must be correct XHTML. If the >> admin types a <p> or a stray '<' for that matter, it will render the >> resulting page not well-formed. >> >> Combine that with the feature of serving XHTML to browsers that accept it, >> and the site breaks on browsers other than IE. >> >> On 11 April 2011 15:33, Nicholas Wehr <[email protected]> wrote:
> I've used this before - perhaps it will work for you: > >> http://ckeditor.com/ >> > > There are two main JS editors, the one above and TinyMCE, you have to be careful though. 1) People paste a Word document paragraph in as HTML and it becomes invalid. Try offering a paste-from-word button to bring up a box they paste into, then send that to the backend to be run through http://search.cpan.org/perldoc?Text::Demoroniser before you add it to the content area. 2) Hitting bugs in these editors giving you invalid XHTML. What you can do is - validate by sending the content server-side before save and check with a DTD schema validator like http://htmlhelp.com/tools/validator/ and on failure disallow save with a popup warning - then offer an option to correct invalid XHTML where you send the content to the backend, run it through htmltidy, then bring it back to the content area; see the HTML -> XHTML docs in http://tidy.sourceforge.net/docs/tidy_man.html Regards, Peter http://perl.dragonstaff.co.uk
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
