Commit Graph

17 Commits

Author SHA1 Message Date
panjan 6b4c6fa193 Fix Markdown styling inside reference links
Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/18096
2016-11-01 09:49:30 +00:00
winniehell 0d8352973b Use JavaScript tooltips for mentions (!5301) 2016-09-01 01:21:34 +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 8a6c3f27e9
Added ReferenceFilter#nodes
This method returns an Array of the HTML nodes as yielded by
ReferenceFilter#each_node. The method's return value is memoized to
allow multiple calls without having to re-query the input document.
2016-06-02 12:30:18 +02:00
Yorick Peterse 2fbfb85492
Returning enums in ReferenceFilter#each_node
This changes ReferenceFilter#each_node so that when it's called without
a block an Enumerator is returned.
2016-06-02 12:30:18 +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
Yorick Peterse 1411480577 Refactor processing of various Banzai filters
These filters now use a single iteration over all the document nodes
instead of multiple ones. This in turn allows variables to be re-used
(e.g. links only have to be unescaped once). Combined with some other
refactoring this can drastically reduce render timings.
2016-04-04 10:44:35 +02:00
Robert Speicher 8558483417 Remove redundant `require`s from Banzai files
We're trying to avoid circular dependency errors.
2016-03-24 13:23:47 -04:00
Grzegorz Bizon 4354bfaba5 Add implementation of reference unfolder using banzai 2016-03-17 07:39:16 +01:00
Stan Hu a10ab94b06 Gracefully handle invalid UTF-8 sequences in Markdown links
Closes #6077
2016-01-20 07:07:53 -08:00
Douwe Maan 2a20c0e590 Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
Jason Lee 41bcab118a Fix #9963 reference_filter "Encoding::CompatibilityError" bug with some complex URL; 2016-01-12 18:19:55 +08:00
Yorick Peterse 3077cb52d9 Use XPath for searching link nodes
This is a tad faster than letting Nokogiri figure out whether it should
evaluate the query as CSS or XPath and then actually evaluating it.
2015-12-31 15:46:47 +01:00
Robert Speicher a97a2d2720 Merge branch 'mention-all' into 'master'
Only allow group/project members to mention `@all`

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3473

See merge request !2205
2015-12-27 21:09:16 +00:00
Douwe Maan 37993d3957 Escape all the things. 2015-12-24 21:36:33 +01:00
Douwe Maan 672cbbff95 Only allow group/project members to mention `@all` 2015-12-24 15:33:51 +01:00
Douwe Maan 7781bda9bd Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00