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
9aac53bcee
Satisfy Rubocop
2015-12-02 10:54:24 +01:00
Douwe Maan
d4030a845e
Pick up direct links to issues/MRs as references.
2015-12-01 16:53:07 +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
4a0ebccf6b
Fix specs
2015-11-30 22:43:54 +01:00
Douwe Maan
bf5e7252ee
Recognize commit range with named refs in compare URLs.
2015-11-30 21:36:35 +01:00
Douwe Maan
d6a5b45c8e
Recognize issue/MR/snippet/commit links as references.
2015-11-30 21:36:34 +01:00
Douwe Maan
a7be01cd07
Render commit range reference with short shas, link to full shas.
2015-11-30 21:10:52 +01:00
Valery Sizov
e92ceb7b57
fix specs
2015-11-30 16:12:31 +02: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
95f0440a78
Merge branch 'master' into rs-redactor-filter
2015-10-15 11:26:58 +02:00
Valery Sizov
8f584d5f2c
Fix: Images cannot show when projects' path was changed
2015-10-14 18:50:35 +03: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
Stan Hu
267687993a
Add comments and clean up test for !1274
2015-09-10 14:24:10 -07:00
Stan Hu
9d3344adbb
Gracefully handle errors in syntax highlighting by leaving the block unformatted
...
Closes #2433
2015-09-10 09:16:27 -07:00
Robert Speicher
e5d89c1084
Remove unnecessary current_user context from filter specs
2015-09-02 23:54:40 -04:00
Robert Speicher
21cacb36a7
Add RedactorFilter specs for invalid Group and Project references
2015-09-01 18:32:52 -04:00
Robert Speicher
7f75300573
Add RedactorFilter
2015-09-01 17:00:29 -04:00
Robert Speicher
454d227b45
Remove all permission checking from Reference filters
2015-09-01 16:58:38 -04:00
Robert Speicher
8e7111f79d
Reference filters no longer take a custom class context option
2015-08-27 15:36:26 -07:00
Robert Speicher
646c1f0324
Re-enable the "links with adjacent text" UserReferenceFilter spec
2015-08-24 18:56:01 -07:00
Robert Speicher
747fe7520b
Remove trailing HTML entities from non-Rinku autolinks as well.
2015-08-20 18:25:16 -07:00
Robert Speicher
fb6f8d9198
Merge branch 'rs-reference-data-attrs' into 'master'
...
Add `data-[type]-id` attribute to reference links
This is to let us redact them later in another filter.
See merge request !1110
2015-08-10 00:07:56 +00:00
Robert Speicher
32e63ba7a1
Add data-[type]-id attribute to reference links
...
This is to let us redact them later in another filter.
2015-08-08 16:43:29 -04:00
Robert Speicher
fb6dc1f07d
Add Group#add_* convenience methods
...
Encapsulates the logic for `Gitlab::Access::WHATEVER` levels.
2015-08-07 00:20:02 -04:00
Robert Speicher
4e22dcb6a3
Add spec to RelativeLinkFilter for Unicode filenames
2015-07-30 17:25:07 -04:00
Stan Hu
52aa21b12d
Fix Style/IndentationWidth cop violations
2015-06-22 22:25:40 -07:00
Robert Speicher
94eff65569
Fix Style/SpaceInsideHashLiteralBraces cop violations
...
These fixes were performed automatically by Rubocop's `-a` flag.
2015-06-22 14:41:00 -04:00
Robert Speicher
9e7a9c63a5
Further limit the limited whitelist for project/group descriptions
2015-06-02 13:41:12 -04:00
Robert Speicher
79c4e3899f
Rename ReferenceFilterSpecHelper to FilterSpecHelper
...
And make it more generalized for all filter specs.
2015-06-02 13:27:53 -04:00
Robert Speicher
023dd2907b
Add a pipeline context option for SanitizationFilter
...
When this option is `:description`, we use a more restrictive whitelist.
This is used for Project and Group description fields.
2015-06-02 13:04:10 -04:00
Robert Speicher
7424d2fa5b
Add ExternalLinkFilter to Markdown pipeline
...
Forces a `rel="nofollow"` attribute on all external links.
2015-05-27 15:39:08 -04:00
Robert Speicher
81a09bc74c
Support only double quotes for multi-word label references
2015-05-26 15:49:20 -04:00
Robert Speicher
94af050117
Use to_reference in reference filter specs
2015-05-26 15:48:32 -04:00
Robert Speicher
136ab73803
Update CommitRange#to_reference to use full SHAs
...
We only want them shortened by the filter, which calls to_s
2015-05-26 15:48:31 -04:00
Robert Speicher
b263a33c80
Better handle label references that aren't actually references
...
Fixes #1690
2015-05-25 16:06:34 -04:00
Robert Speicher
8ee382087d
Subclass TaskList::Filter to fix a bug
...
Instead of using a fork, we subclass the filter and only apply the
`task-list` class to list items that actually are task lists.
Closes #1645
See https://github.com/github/task_list/pull/60
2015-05-20 12:08:33 -04:00
Robert Speicher
7f2fb72a0a
Minor RelativeLinkFilter cleanup
2015-05-13 14:08:37 -04:00
Jakub Jirutka
44b82396d1
Add spec for RelativeLinkFilter
2015-05-12 02:12:47 +02:00
Robert Speicher
70bbf093aa
Remove class and id attributes from SanitizationFilter whitelist
2015-05-08 12:31:34 -04:00
Robert Speicher
0027c2ddd7
Add Project#get_issue
2015-04-30 16:35:27 -04:00
Robert Speicher
cd3c24a8f3
Autolink short URLs
2015-04-30 16:35:27 -04:00
Robert Speicher
f4fac3ac87
Add jira_project project factory
2015-04-30 16:35:27 -04:00
Robert Speicher
e46d1cdd8b
Add Gitlab::Markdown::SanitizationFilter
...
This just extends the HTML::Pipeline::SanitizationFilter with our custom
whitelist.
2015-04-30 16:35:25 -04:00