gitlab-org--gitlab-foss/lib
Douwe Maan e4ac6bbf82 Merge branch 'atom-xhtml-squashed' into 'master'
Fix invalid Atom feeds when using emoji, horizontal rules, or images

This is a fix for issues #880, #723, #1113.

Markdown must be rendered to XHTML, not HTML, when generating summary content for Atom feeds. Otherwise, content-less tags like *img* and *hr* are not terminated and make the Atom XML invalid. Such tags are generated when issue descriptions, merge request descriptions, comments, or commit messages use emoji, horizontal rules, or images.

To pass this option through from the relevant Haml templates to the proper place in the `gfm()` method, a new method `gfm_with_options()` is introduced. It reuses the options dictionary passed to `markdown()` and interprets options `xhtml` and `parse_tasks` from it (the latter was a convenient replacement for `gfm_with_tasks()`). `xhtml` is already interpreted by Redcarpet::Render::HTML, but that alone was not sufficient, because the post-processing in `gfm()` would convert its XHTML tags back to HTML.

I found no way of passing additional optional options to the existing `gfm()` method without requiring updates to existing callers and without getting in the way of the existing optional arguments, but maybe someone who knows more about Ruby than I can think of one.

Thorough review appreciated since this is the first time I have used Ruby.

See merge request !344
2015-03-17 08:38:38 +00:00
..
api Merge branch 'fix-restricted-visibility' into 'master' 2015-03-16 17:49:46 +00:00
assets
backup Revert "Merge branch 'backup-permissions' into 'master'" 2015-03-16 23:51:46 -07:00
gitlab Merge branch 'atom-xhtml-squashed' into 'master' 2015-03-17 08:38:38 +00:00
redcarpet/render Merge branch 'atom-xhtml-squashed' into 'master' 2015-03-17 08:38:38 +00:00
support Fix typo 2015-03-14 10:22:06 +01:00
tasks Let the server fix unconfigured git 2015-03-16 16:28:20 +01:00
disable_email_interceptor.rb Add email interceptor to prevent mail sending if email sending is disabled. 2014-10-27 13:05:50 +01:00
email_validator.rb More rubocop rules enable 2015-02-02 21:31:03 -08:00
event_filter.rb Add parenthesis to function def with arguments. 2014-10-03 09:18:46 +02:00
extracts_path.rb Upgrade to Rails 4.1.9 2015-02-14 11:09:23 -07:00
file_size_validator.rb
gt_one_coercion.rb diff unfold 2014-08-14 15:48:14 +04:00
repository_cache.rb Fix RepositoryCache backend attr_reader 2015-01-30 10:17:55 -05:00
static_model.rb
unfold_form.rb diff unfold 2014-08-14 15:48:14 +04:00