[Catalyst] Validation of entered content

John M. Dlugosz wxju46gefd at snkmail.com
Tue Apr 12 11:21:05 GMT 2011


Thanks for the comprehensive reply!  That will keep my busy for a while.

On 4/11/2011 10:25 AM, Peter Edwards peter-at-dragonstaff.co.uk |Catalyst/Allow to home| 
wrote:
>
> 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
>




More information about the Catalyst mailing list