[openstreetmap/openstreetmap-website] Switch to using kramdown for markdown formatting (#2111)
Tom Hughes
notifications at github.com
Wed Jan 9 18:30:51 UTC 2019
As suggested by @gravitystorm in #2103 this switches our markdown formatting to use kramdown instead of redcarpet.
As kramdown doesn't have the builtin sanitisation features of redcarpet I have passed the resulting HTML through the sanitiser used for other formats and have also added a few extra restrictions to links in user generated content.
Note that this doesn't fix all the issues in #2103 as bullet lists nested in numbered lists still don't seem to work as the reporter there is expecting.
Also I noticed that redcarpet was turning thinks which look like links but have no link markup into links which kramdown doesn't - we could fix that by running our autolinker if we wanted.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/2111
-- Commit Summary --
* Switch to using kramdown for markdown formatting
* Add noopener and noreferer to links in user generated content
-- File Changes --
M Gemfile (2)
M Gemfile.lock (4)
M config/initializers/sanitize.rb (2)
M config/locales/en.yml (2)
M lib/rich_text.rb (20)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/2111.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2111.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2111
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190109/c70fccd5/attachment-0001.html>
More information about the rails-dev
mailing list