readme: allow non-HTML formats
commit428fa6f18538eccdd840d9c2440008334f059e15
authorKyle J. McKay <mackyle@gmail.com>
Mon, 1 Mar 2021 16:51:26 +0000 (1 09:51 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 1 Mar 2021 16:51:26 +0000 (1 09:51 -0700)
tree89a7c4756eb6d95bbd4f993fc00145e403533f1b
parentc8cb783ac23ab07dfb4bb2d054f07df1b9e62706
readme: allow non-HTML formats

Provide a "README Format" selection to choose between 'Markdown',
'Plain Text' and 'HTML' for an explicit README on the project page.

As before, leaving the actual readme content blank results in the
"Automatic README" mode.

'Plain Text' simply XML-escapes the content and stuffs it into
a "<pre>...</pre>" section.

'Markdown' passes it through the same Markdown processor as for
an "Automatic README" in Markdown format.  This is now the default
format.

'HTML' represents the only previously allowed format and will
automatically be selected for non-empty legacy explict HTML README
contents.  However, HTML is now always validated courtesy of the
Markdown module's ProcessRaw function.  It's also now sanitized (no
more scripts, style tags [style attributes are still okay], javascript
attributes, etc.).  Content that is "almost-XML HTML" will be
automatically "fixed up" rather than erroring out like it used to.

The raw README content data is now stored in the file 'README.dat'
alongside the processed result that's always stored in 'README.html'
(thereby maintaining full gitweb compatibility).

Just a few minor housekeeping updates to go along with this change.
Make projtool show a length for the new READMEDATA value (similarly
to how it handles the README value).  Add the new 'README.dat' file
to the list of files included in a project's BOM.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Project.pm
cgi/regproj.cgi
toolbox/create_projects_bom.pl
toolbox/projtool.pl