Commit Graph

12 Commits

Author SHA1 Message Date
Douwe Maan 8a4d68c53e Enable Style/ConditionalAssignment 2017-02-23 09:31:57 -06:00
Douwe Maan dbfa58e2da Copying a rendered issue/comment will paste into GFM textareas as actual GFM 2017-01-16 16:14:18 -05:00
Felipe Artur 8e4301d982 Prevent wrong markdown on issue ids when project has Jira service activated 2016-10-19 13:46:04 -02:00
Paco Guzman c3f504169b AbstractReferenceFilter caches current project_ref on RequestStore when active
Before we weren’t caching current_project_ref because normally the reference to 
the current project doesn’t include the path with namespace. But now we store 
the current project in the projects reference cache to be used for the same 
filter when accessing using path with namespace of for subsequent filters executed on the cache.
2016-09-28 14:37:24 +02:00
Yorick Peterse a4ce2d126d
Handle external issues in IssueReferenceFilter
IssueReferenceFilter will end up processing internal issue references
when a project uses an external issues tracker while still using
internal issue references (in the form of `#\d+`). This commit ensures
that these links are rendered as external issue links, regardless of
whether the project one currently views uses an internal or external
issues tracker.

Fixes gitlab-org/gitlab-ce#19036, gitlab-com/performance#16
2016-06-30 11:52:44 +02:00
Yorick Peterse ceeba75c76
Handle external issues in IssueReferenceFilter
In the past this class would use Project#get_issue to retrieve an issue
by its ID. This method would automatically determine whether to return
an Issue or ExternalIssue.

This commit changes IssueReferenceFilter to handle external issues again
and in a somewhat more explicit manner than before.

Fixes gitlab-org/gitlab-ce#18827
2016-06-21 20:01:56 +02:00
Yorick Peterse 19a290e7bf
Reduce queries in IssueReferenceFilter
This reduces the number of queries executed in IssueReferenceFilter by
retrieving the various projects/issues that may be referenced in batches
_before_ iterating over all the HTML nodes.

A chunk of the logic resides in AbstractReferenceFilter so it can be
re-used by other filters in the future.
2016-06-16 14:04:45 +02:00
Yorick Peterse 86166d2802
Split Markdown rendering & reference gathering
This splits the Markdown rendering and reference extraction phases into
two distinct code bases. The reference extraction phase no longer relies
on the html-pipeline Gem (and any related code) and allows for
extracting of references from multiple HTML nodes in a single pass. This
means that if you want to extract user references from 200 comments you
no longer need to run 200 times N number of queries, instead only a
handful of queries may be needed.
2016-05-26 17:14:00 +02:00
Benedikt Huss bf0fd3ea1b Links for redmine issue references are generated correctly again 2016-05-10 00:37:15 +02:00
Douglas Barbosa Alexandre 43d8bdb4f0 Restrict access to references for confidential issues 2016-03-17 20:55:59 -03:00
Douwe Maan 2a20c0e590 Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
Douwe Maan 7781bda9bd Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00