GEWIS / gewisweb

GEWIS Website
https://gewis.nl
GNU General Public License v3.0
16 stars 33 forks source link

Improved activity description editing #1760

Closed tomudding closed 7 months ago

tomudding commented 7 months ago

For Activity descriptions Markdown was already the standard but the editor nor the parser enforces this. This can lead to people breaking the layout of the page when their HTML is not properly structured and/or formatted. To make sure that this is not possible, the editor now ONLY supports Markdown. Technically it is the GitHub Flavour of Markdown.

Additionally, this removes the old and outdated editor which was broken since its introduction (the preview functionality was never implemented).

NewsItems and OrganInformation long text/description also have no need for custom and/or complex HTML formatting, so that editor has also been switched to only support GFM.

maglnet/maglmarkdown appears to be abandoned, as such it has been replaced with league/commonmark. league/commonmark was actually one of the Markdown converts in maglnet/maglmarkdown.

This is essentially a drop-in replacement with the addition of the Markdown view helper. Configuration ensures that GitHub Flavoured Markdown is supported. Additionally, HTML content is escaped and not stripped. Unsafe URLs are not allowed. External URLs are automagically changed to open in a new tab, with the appropriate rel attribute.


To ensure that there is enough space for the new Markdown editor the activity creation page has been moved to the admin section of the website.

image


Activity descriptions now also keep a bit more structure underneath the reveal: image

This closes GH-997, closes GH-1552, closes GH-1757, closes GH-1755, and closes GH-1758.