Commit Graph

127 Commits

Author SHA1 Message Date
Douwe Maan 7781bda9bd Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00
Douwe Maan 10387f6b8a Merge branch 'master' into tmp-reference-pipeline-and-caching
# Conflicts:
#	spec/lib/gitlab/markdown/autolink_filter_spec.rb
#	spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/cross_project_reference_spec.rb
#	spec/lib/gitlab/markdown/emoji_filter_spec.rb
#	spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/external_link_filter_spec.rb
#	spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/label_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/redactor_filter_spec.rb
#	spec/lib/gitlab/markdown/reference_gatherer_filter_spec.rb
#	spec/lib/gitlab/markdown/relative_link_filter_spec.rb
#	spec/lib/gitlab/markdown/sanitization_filter_spec.rb
#	spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
#	spec/lib/gitlab/markdown/table_of_contents_filter_spec.rb
#	spec/lib/gitlab/markdown/task_list_filter_spec.rb
#	spec/lib/gitlab/markdown/upload_link_filter_spec.rb
#	spec/lib/gitlab/markdown/user_reference_filter_spec.rb
2015-12-10 14:04:34 +01:00
Douwe Maan 23b6a98de0 Move Builds tab to the end 2015-12-08 22:28:28 +01:00
Douwe Maan 1a10945066 Fix RedactorFilter 2015-12-08 13:40:23 +01:00
Douwe Maan af6b543742 Make commit and MR ref filters aware of /builds path 2015-12-08 13:22:20 +01:00
Douwe Maan 13f44822d9 Move CombinedPipeline methods around 2015-12-08 12:29:48 +01:00
Robert Speicher 611912fe68 Store the demodulized reference filter name in data attribute 2015-12-07 19:40:46 -05:00
Douwe Maan d611a38798 Merge branch 'master' into reference-pipeline-and-caching 2015-12-07 14:48:53 +01:00
Douwe Maan f9d954fae7 Satisfy rubocop 2015-12-03 19:02:56 +01:00
Douwe Maan 0de8e26066 Pass original text along with label reference filter. 2015-12-03 14:00:41 +01:00
Douwe Maan f905fd239c Use URL helpers in specs 2015-12-03 14:00:09 +01:00
Douwe Maan 60828ab40e Merge branch 'master' into link-refs 2015-12-02 12:12:03 +01:00
Douwe Maan 2955ca613b Merge branch 'master' into reference-pipeline-and-caching 2015-12-02 11:20:51 +01:00
Douwe Maan 2f5074dc39 Expand inline docs. 2015-12-01 17:14:42 +01:00
Douwe Maan d4030a845e Pick up direct links to issues/MRs as references. 2015-12-01 16:53:07 +01:00
Douwe Maan 1d6d757dbd Allow reference format as link href 2015-12-01 16:25:56 +01:00
Douwe Maan f3ea06eb7f Autolink first so we don't pick up numeric anchors as issue references. 2015-12-01 15:53:32 +01:00
Douwe Maan 62c14ba2ed Render commit reference using short sha, but include full sha in comment. 2015-12-01 12:58:45 +01:00
Douwe Maan bd4ab21c07 Fix code docs 2015-12-01 12:49:22 +01:00
Douwe Maan d6a5b45c8e Recognize issue/MR/snippet/commit links as references. 2015-11-30 21:36:34 +01:00
Valery Sizov 7f214cee74 Migrate mailers to ActiveJob 2015-11-26 17:03:43 +02:00
Douwe Maan e1e67d383e Move Markdown filters and pipelines into folders. 2015-11-19 16:18:13 +01:00
Douwe Maan f5a630111f Merge branch 'master' into reference-pipeline-and-caching 2015-11-19 15:46:04 +01:00
Dmitriy Zaporozhets 49e32cb59f
Remove small code duplication in user_reference_filter.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-17 12:55:16 +01:00
Dmitriy Zaporozhets 79fa6c646c Remove duplication in reference filters
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-16 23:56:16 +01:00
Alec Cooper 4bb99677b1 Relative links in the README file shown on the repository homepage should point
to the default branch, not to master
2015-11-14 15:00:55 -05:00
Douwe Maan 329e067ff1 Merge branch 'rs-dev-issue-2613' into 'master'
Add custom protocol whitelisting to SanitizationFilter

Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2613

We allow any protocol for autolinks: irc://irc.freenode.net/git

But manual Markdown links with the same protocol get sanitized: `[This will not be clickable](irc://irc.freenode.net/git)`: [This will not be clickable](irc://irc.freenode.net/git)

To get around this we have to first allow *all* protocols, and then manually clean dangerous (i.e., `javascript:`) protocols.

See merge request !1496
2015-11-02 10:49:46 +00:00
Douwe Maan abbca6151d Make pipelines actually make sense 2015-10-21 12:32:30 +02:00
Douwe Maan de0acf3cf7 Merge branch 'master' into reference-pipeline-and-caching 2015-10-21 11:36:41 +02:00
Yorick Peterse afdc028516 Speed up searching for text references a bit
If a node is ignored there's no need for searching for a given pattern.
In turn, when searching for the pattern there's no need to construct a
MatchData object as we only care about presence (or lack thereof), not
the resulting matches.

In terms of performance this cuts down about 200 ms when loading
issue #2164 locally, though this varies a bit depending on system load.
2015-10-20 15:52:40 +02:00
Douwe Maan 95f0440a78 Merge branch 'master' into rs-redactor-filter 2015-10-15 11:26:58 +02:00
Douwe Maan 539de0dd81 Merge branch 'master' into rs-redactor-filter 2015-10-14 20:23:36 +02:00
Douwe Maan ed41333a6e Use Gitlab::Markdown.render with :pipeline option rather than different methods 2015-10-14 19:28:09 +02:00
Valery Sizov 8f584d5f2c Fix: Images cannot show when projects' path was changed 2015-10-14 18:50:35 +03:00
Douwe Maan d313a7681b Explicitly only parse references by specified filter 2015-10-14 09:46:06 +02:00
Douwe Maan cd2583a3be Code cleanup 2015-10-13 23:03:53 +02:00
Douwe Maan 93fcddd7a7 Allow ReferenceExtractor to efficiently load references from multiple texts at once 2015-10-13 22:53:05 +02:00
Douwe Maan 251e13666d Efficiently load multiple references of one type. 2015-10-13 18:23:49 +02:00
Douwe Maan 5dd77358f6 Pass project to RedactorFilter 2015-10-13 13:36:47 +02:00
Douwe Maan 9d066bc941 Raise error when a ReferenceFilter doesn't implement referenced_by 2015-10-08 13:00:49 +02:00
Douwe Maan e6419cecf4 Update inline doc 2015-10-08 13:00:49 +02:00
Robert Speicher e0f9d3a547 Update ReferenceFilter docs
[ci skip]
2015-10-07 18:40:54 -04:00
Douwe Maan 72afcbcd37 Always allow references to the current project 2015-10-07 19:19:23 +02:00
Douwe Maan f42cfa9e87 Refactor reference gathering to use a dedicated filter 2015-10-07 17:00:48 +02:00
Douwe Maan 4f629dab2a Merge branch 'master' into rs-redactor-filter 2015-10-07 15:15:35 +02:00
Robert Speicher 16f8ca566b Add custom protocol whitelisting to SanitizationFilter
Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2613
2015-10-01 23:40:29 -04:00
Robert Speicher 2b94f5fb06 Allow RelativeLinkFilter to go up multiple directories 2015-09-20 19:21:33 -04:00
Robert Speicher 619f04c196 Allow relative links to go up one directory level 2015-09-18 14:03:42 -04:00
Dmitriy Zaporozhets e3c30bf2e8
Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-11 16:32:11 +02:00
Douwe Maan 4f461fd45f Merge branch 'rs-fix-highlighting' into 'master'
Syntax highlighting improvements

On the server side:

During development I would occasionally see SanitizationFilter sanitizing
the result of SyntaxHighlightFilter, even though its attributes were
whitelisted. This updates the `clean_spans` transformer to return the
whitelisted node as [suggested by the Sanitize docs](http://git.io/vZR8i).

On the client side:

- Makes the syntax_highlight JS more flexible
- Adds JS specs
- Simplifies highlighting of new notes
- Adds highlighting to Markdown preview

See merge request !1278
2015-09-11 08:47:13 +00:00