Commit graph

14 commits

Author SHA1 Message Date
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
Christian Walther
90aa870c36 Fix invalid Atom feeds when using emoji, horizontal rules, or images.
Fixes 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>, generated when issue descriptions, merge request descriptions, comments, or commit messages use emoji, horizontal rules, or images, are not terminated and make the Atom XML invalid.
2015-03-16 22:05:52 +01:00
Vinnie Okada
76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07:00
Jeroen van Baarsen
026e988544 Even more hound fixes
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 21:00:55 +01:00
Jeroen van Baarsen
0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Dmitriy Zaporozhets
8cc111bd03 Fix random failing test 2015-01-27 13:40:23 -08:00
Jeroen van Baarsen
2a4ee2fd7f make sure the user.name is escaped
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-01-04 14:09:35 +01:00
Dmitriy Zaporozhets
a46fe875c6
Feature: atom feed for user activity
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-04 21:49:19 +02:00
Ciro Santilli
89f7345f3f Remove unnecessary page. from tests. 2014-09-26 09:51:17 +02:00
Dmitriy Zaporozhets
6485570482
Increase atom feed test coverage. Prevent 500 error if description is missing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-20 11:55:58 +03:00
Jeroen van Baarsen
8362026a33 Split feature tests out to different build job 2014-04-13 19:05:52 +02:00
Dmitriy Zaporozhets
5e30f4d54c
Fix dashboard atom feed
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-10 17:32:36 +02:00
Hiroyuki Sato
df9cbbc924 Drop support of root namespace in routing 2013-09-13 07:00:24 +09:00
Dmitriy Zaporozhets
03f6a28ec0 move capybara scenarios to spec/features 2013-02-21 10:41:37 +02:00