Commit Graph

70 Commits

Author SHA1 Message Date
GitLab Bot a988d02fc7 Add latest changes from gitlab-org/gitlab@master 2023-07-25 03:09:58 +00:00
GitLab Bot c972699d39 Add latest changes from gitlab-org/gitlab@master 2023-06-20 21:09:21 +00:00
GitLab Bot 5103041796 Add latest changes from gitlab-org/gitlab@master 2023-03-10 12:11:10 +00:00
GitLab Bot 0c1344a7c1 Add latest changes from gitlab-org/gitlab@master 2023-03-09 12:15:54 +00:00
GitLab Bot da03179135 Add latest changes from gitlab-org/gitlab@master 2022-12-23 03:10:18 +00:00
GitLab Bot 1690313142 Add latest changes from gitlab-org/gitlab@master 2022-12-08 21:09:17 +00:00
GitLab Bot 30b8ea126f Add latest changes from gitlab-org/gitlab@master 2022-10-31 18:09:25 +00:00
GitLab Bot b1928c08f1 Add latest changes from gitlab-org/gitlab@master 2022-10-13 18:10:20 +00:00
GitLab Bot b3e461ab0f Add latest changes from gitlab-org/gitlab@master 2022-10-07 00:08:16 +00:00
GitLab Bot ec3e75cfea Add latest changes from gitlab-org/gitlab@master 2022-06-15 21:10:04 +00:00
GitLab Bot 06b21ad63c Add latest changes from gitlab-org/gitlab@master 2022-03-16 21:09:14 +00:00
GitLab Bot cce7638874 Add latest changes from gitlab-org/gitlab@master 2022-03-08 15:15:55 +00:00
GitLab Bot aacba12c6e Add latest changes from gitlab-org/gitlab@master 2021-12-13 15:12:59 +00:00
GitLab Bot 77b8390171 Add latest changes from gitlab-org/gitlab@master 2021-11-24 12:10:21 +00:00
GitLab Bot f7bc7dc5ea Add latest changes from gitlab-org/gitlab@master 2021-06-01 21:10:06 +00:00
GitLab Bot 6463521e08 Add latest changes from gitlab-org/gitlab@master 2021-04-19 18:09:09 +00:00
GitLab Bot 413119517c Add latest changes from gitlab-org/gitlab@master 2021-04-07 18:09:45 +00:00
GitLab Bot 889bf7a0ee Add latest changes from gitlab-org/gitlab@master 2021-03-16 18:11:53 +00:00
GitLab Bot 507c0e71cd Add latest changes from gitlab-org/gitlab@master 2021-01-27 12:09:01 +00:00
GitLab Bot ace0df53d3 Add latest changes from gitlab-org/gitlab@master 2020-11-30 18:09:46 +00:00
GitLab Bot 6535cf9c79 Add latest changes from gitlab-org/gitlab@master 2020-11-17 15:09:28 +00:00
GitLab Bot d6348d22dd Add latest changes from gitlab-org/gitlab@master 2020-06-24 09:08:32 +00:00
GitLab Bot 340fd2966e Add latest changes from gitlab-org/gitlab@master 2020-06-04 00:08:17 +00:00
GitLab Bot 100a5e4bea Add latest changes from gitlab-org/gitlab@master 2020-05-25 21:08:00 +00:00
GitLab Bot a5650b86b5 Add latest changes from gitlab-org/gitlab@master 2020-05-13 21:08:55 +00:00
GitLab Bot 219eead23f Add latest changes from gitlab-org/gitlab@master 2020-03-10 18:08:17 +00:00
GitLab Bot d80f3cd75e Add latest changes from gitlab-org/gitlab@master 2020-03-04 09:08:20 +00:00
GitLab Bot e06d0e7796 Add latest changes from gitlab-org/gitlab@master 2020-02-25 15:08:50 +00:00
GitLab Bot 163a7046ac Add latest changes from gitlab-org/gitlab@master 2020-02-18 15:08:51 +00:00
GitLab Bot 0d6fa03312 Add latest changes from gitlab-org/gitlab@master 2020-02-06 18:08:54 +00:00
GitLab Bot 22e9af3c8b Add latest changes from gitlab-org/gitlab@master 2020-01-27 12:08:35 +00:00
GitLab Bot 5ad0cf2655 Add latest changes from gitlab-org/gitlab@master 2020-01-23 12:08:38 +00:00
GitLab Bot c158fa8d69 Add latest changes from gitlab-org/gitlab@master 2020-01-16 12:08:32 +00:00
GitLab Bot 85e494935a Add latest changes from gitlab-org/gitlab@master 2020-01-14 15:07:55 +00:00
GitLab Bot b8e30b446d Add latest changes from gitlab-org/gitlab@master 2020-01-13 03:07:51 +00:00
GitLab Bot 7f8330873c Add latest changes from gitlab-org/gitlab@master 2019-12-18 21:07:37 +00:00
GitLab Bot e723867717 Add latest changes from gitlab-org/gitlab@master 2019-12-17 18:07:48 +00:00
GitLab Bot 29c01c6c91 Add latest changes from gitlab-org/gitlab@master 2019-11-14 03:06:25 +00:00
GitLab Bot 8423ed74e6 Add latest changes from gitlab-org/gitlab@master 2019-11-02 15:06:18 +00:00
Luke Duncalfe 49a78d419d Pass all wiki markup formats through pipelines
Previously, when the wiki page format was anything other than `markdown`
or `asciidoc` the formatted content would be returned though a Gitaly
call. Gitaly in turn would delegate formatting to the gitlab-gollum-lib
gem, which in turn would delegate that to various gems (like RDoc for
`rdoc`) and then apply some very liberal sanitization.

It was too liberal!

This change brings our wiki content formatting in line with how we
format other markdown at GitLab, so we have a SSOT for sanitization.

https://gitlab.com/gitlab-org/gitlab/issues/30540
2019-10-23 11:42:37 +13:00
GitLab Bot dea6ebd31a Add latest changes from gitlab-org/gitlab@master 2019-09-30 12:06:01 +00:00
Heinrich Lee Yu be0f039d9c Fix upload URLs in Markdown
Fixes RelativeLinkFilter for users that don't have access
to the project's repository
2019-09-02 13:03:14 +08:00
Oswaldo Ferreira 4daf3dc0db Avoid exposing unaccessible repo data upon GFM processing
When post-processing relative links to absolute links
RelativeLinkFilter didn't take into consideration that
internal repository data could be exposed for users
that do not have repository access to the project.

This commit solves that by checking whether the user
can `download_code` at this repository, avoiding any
processing of this filter if the user can't.

Additionally, if we're processing for a group (
no project was given), we check if the user can
read it in order to expand the href as an extra.
That doesn't seem necessarily a breach now,
but an extra check doesn't hurt as after all
the user needs to be able to `read_group`.
2019-08-21 12:23:44 -03:00
Vasiliy Yakliushin 22e2217c95 Fix undefined method `simple_format for MarkupHelper:Module
`simple_format` is not defined in ActionView::Helpers::TagHelper, but
it is actually located in ActionView::Helpers::TextHelper.

The solution is to include the correct helper.

I've also added tests for `#markup_unsafe` because they were missing.
2019-07-07 11:49:53 +02:00
Stan Hu 0e341a6e58 Fix attachments using the wrong URLs in e-mails
Prior to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29889,
only the project context were set for the Markdown renderer. For a note
on an issuable, the group context was set to `nil` because
`note.noteable.try(:group)` attempted to get the issuable's group, which
doesn't exist.

To make group notifications work, now both the project and group context
are set. The context gets passed to `RelativeLinkFilter`, which
previously assumed that it wasn't possible to have both a group and a
project in the Markdown context. However, if a group were defined, it
would take precedence, and the URL rendered for uploads would be
`/group/-/uploads` instead of `/group/project/uploads/`. This led to
404s in e-mails.

However, now that we have both project and group in the context, we
render the Markdown giving priority to the project context if is set.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63910
2019-06-28 22:08:46 -07:00
Patrick Bajao 2eecfd8f9d Use Redis for CacheMarkDownField on non AR models
This allows using `CacheMarkdownField` for models that are not backed
by ActiveRecord.

When the including class inherits `ActiveRecord::Base` we include
`Gitlab::MarkdownCache::ActiveRecord::Extension`. This will cause the
markdown fields to be rendered and the generated HTML stored in a
`<field>_html` attribute on the record. We also store the version
used for generating the markdown.

All other classes that include this model will include the
`Gitlab::MarkdownCache::Redis::Extension`. This add the `<field>_html`
attributes to that model and will generate the html in them. The
generated HTML will be cached in redis under the key
`markdown_cache:<class>:<id>`. The class this included in must
therefore respond to `id`.
2019-06-05 13:19:59 +08:00
Jan Provaznik b2c70230b3 Remove Redcarpet markdown engine
This engine was replaced with CommonMarker in 11.4, it was deprecated
since then.
2019-02-04 12:48:35 +01:00
Brett Walker 635d901288 Remove images in 'first_line_in_markdown'
By default, we now strip images in the 'first_line_in_markdown'
method.  This keeps images from being displayed in the
one-liner of both todo and project activity panels.

Although not currently used, we allow images to be preserved
with the allow_images: true options.
2018-09-13 10:33:06 -05:00
Brett Walker c4f26d4b1c added feature flag 'commonmark_for_repositories' 2018-09-05 09:19:16 -05:00
Brett Walker 5a7451c2f9 Enable CommonMark for files and wikis 2018-09-05 09:19:16 -05:00