Bug 1545

Summary: webforum: allow some HTML tags in the posts
Product: [Websites] maemo.org Website Reporter: Marcell Lengyel <marcell>
Component: GeneralAssignee: Henri Bergius <henri.bergius>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: High CC: bugzilla770, oskari.kokko, quim.gil
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
URL: https://maemo.org/community/test_forum/

Description Marcell Lengyel (reporter) maemo.org 2007-06-14 15:30:36 UTC
Let's have a whitelist of safe HTML tags that would be allowed in webforum
posts.

A possible starting point could be something similar that eg. wordpress.com is
considering safe: address, a, abbr, acronym, b, big, blockquote, br, caption,
cite, class, code, col, del, dd, div, dl, dt, em, font, h1…h6, i, img, ins,
kbd, li, p, pre, q, s, span, strike, strong, sub, sup, table, tbody, td, tfoot,
tr, tt, ul, ol, var

All the other tags should be rendered as plain text.
Comment 1 eero.afheurlin 2007-06-14 16:07:24 UTC
We can do content rewriting after the general case of formatting is done.
Sensible (there are some more available but they're not really usable for the
scenario) formatting options are:

- markdown (http://www.michelf.com/projects/php-markdown/extra/)
  - pros: allows html
  - cons: markdown treats certain characters commonly seen in unix shells as
special (especially issue for people using exclusively the mailing list)
- "plain text" (nl2br(htmlspecialchars('data'))
  - pros: simplest way to preserve intention of mailing list posters
  - cons: escapes all HTML

We can use different formatting for messages imported from the mailing list and
ones submitted via the web interface.

Mails sent out to the list from the web-interface are plaintext and do not go
trough the formatter used to make the posts more readable on the web.

New generic formatter to overcome the limitations of the two above can of
course be coded but it needs a proper specification.

Given these limitations and corner cases what exactly we want to do with

1. messages posted via the web interface
2. messages posted via the mailing list

/Rambo
Comment 2 Marcell Lengyel (reporter) maemo.org 2007-06-14 16:14:55 UTC
Since this is an enhancement request I would like to see the general formatter.
I think that web posts and mailing list posts should be treated in the same
way.
Anyway, this feature could be a future enhancement if it requres much work (as
it seems it does).
Comment 3 petri.kanerva 2007-08-16 16:59:59 UTC
This issue will be addressed in couple of weeks.
Comment 4 Henri Bergius 2007-09-17 16:58:40 UTC
We have another project where integration with HTML-cleaning library is needed:

http://htmlpurifier.org/

I will update this bug when that other project moves forward.
Comment 5 Neil MacLeod maemo.org 2007-09-19 06:22:05 UTC
Can I ask why you are not planning on using standard web forum software (eg.
vBulletin) for the Maemo web forum?
Comment 6 Henri Bergius 2007-09-19 07:15:54 UTC
Because this is not just a web forum, but a full web read/write interface to
the mailing lists.
Comment 7 Henri Bergius 2007-09-20 13:13:29 UTC
Regarding white/blacklisting HTML, the PHP HTMLPurifier class is very useful:

http://htmlpurifier.org/

With it we could even allow full HTML entry on forums safely.
Comment 8 Quim Gil nokia 2008-07-19 15:37:16 UTC
Webforum task belongs to Sprint2. Changing priority to HIGH.
Comment 9 Quim Gil nokia 2008-07-21 08:18:54 UTC
Unsure who is responsible of the webforum nowadays, Henri or Oskari?
Comment 10 Henri Bergius 2008-07-30 15:18:05 UTC
I'm working on this.
Comment 11 Henri Bergius 2008-07-31 11:24:46 UTC
WONTFIXing this after all.

While technically easy to do, the problem is that:

* If we start posting HTML mails to the mailing lists a lot of users will hate
us
* If we allow HTML on web forum, but strip it away for the mailing list version
the two will be unequal (links or images may disappear etc)

If these problems are acceptable then please reopen and I will implement this.