From: "John M. Dlugosz" <[email protected]>
>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.
> 
> What's a good way to validate something programmatically before committing 
> it?  Better 
> yet, is there a rich editor or wiki- or phpbbs-like translator that I might 
> use for 
> soliciting the input that I might use instead?
> 
> The current content has a couple paragraphs and a bulleted list.  So it's not 
> just a 
> simple blank, but must allow an amount of rich content.



Better than storing html, store a Textile format which is easy readable and 
similar to plain text when not rendered, but which renders as valid html.

You can use

http://search.cpan.org/~bchoate/Text-Textile-2.12/lib/Text/Textile.pm

or you can use 

http://search.cpan.org/~idoperel/DBIx-Class-InflateColumn-Markup-Unified-v0.21.1/lib/DBIx/Class/InflateColumn/Markup/Unified.pm

for beeing able to choose if you want to store the markup as Textile, Markdown 
or BBCode.

The Textile format allows the biggest flexibility and you can also use html 
elements in it, but you can create with its features headings, lists of 
different formats, tables with many settings, links, images, and many other 
things.

Octavian


_______________________________________________
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/

Reply via email to