educloudalliance / educloud-bazaar-legacy

Service and material distribution channel
4 stars 2 forks source link

HTML in description fields #37

Closed jplahti closed 9 years ago

jplahti commented 9 years ago

Some test materials in basaar seem to contain HTML-code in description fields. The specification does not seem to say is it by design.

This can be a problem for LMS-systems. Good systems filter the HTML for security reasons and the end result might not be what the publisher was hoping for. Some systems might always print content out as plain text, exposing the HTML, not again what the publisher ment. Bad systems might cause security issues or broken user interfaces by blindly using the HTML.

My proposal would be that description field is always plain text and additional descriptionHTML field might be added as an optional field.

TuulaP commented 9 years ago

Hmmm. Good point. Maybe the default description field could be plain-ascii, if that is what LMSs expect.

However, it would be nice if there would be formattedDescription and formattedDescriptionType fields. In this scenario formattedDescription would be shown on basaar-ui. The formatted type could be list, which could be enhanced first to HTML and maybe later to allow Markdown (like kysy.pilvivayla.fi or this editor).

If this change is made, is the existing data converted to correct fields by basaar people, or shall CMS to insert their data again? (During this reference platform creation either is ok, but IRL the field format changes shouldn't require from CMS anything.)

DeWa commented 9 years ago

Commit 1f82d5cdd67a49a53cba0c23db83a45065d560ba: HTML in description is now converted into ASCII (and Markdown for possible future support) when posting or updating items via API. At the moment we are not editing existing data. Converting with a script would make existing descriptions very messy (all tags would be converted into Markdown which isn't supported yet). So, in my opinion, the best solution for now is just leave the HTML.