Commit Graph
77 Commits
Author SHA1 Message Date
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
Stan Hu 267687993a Add comments and clean up test for !1274 2015-09-10 14:24:10 -07:00
Robert Speicher e3c97ede96 RU-BO-COOOOOOOOP 2015-09-10 16:06:24 -04:00
Robert Speicher 7cbf5e4d18 Prevent result of SyntaxHighlightFilter being sanitized 2015-09-10 15:08:06 -04: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
Dmitriy Zaporozhets 0b5d627cd4 Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g 2015-09-09 14:56:02 +02:00
Robert Speicher c104f4d590 Remove unnecessary strip from reference_class method 2015-08-31 16:23:46 -04:00
Robert Speicher 9bb06ae9ef Make sure the main Gitlab::Markdown module gets loaded before filters 2015-08-27 16:02:49 -07:00
Robert Speicher 8e7111f79d Reference filters no longer take a custom class context option 2015-08-27 15:36:26 -07:00
Robert Speicher 4340dd3eeb Decouple Gitlab::Markdown from the GitlabMarkdownHelper
This module is now the sole source of knowledge for *how* we render
Markdown (and GFM).
2015-08-27 14:17:26 -07:00
Douwe Maan 046b283127 Groundwork for merging CI into CE 2015-08-25 18:42:46 -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 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 4e22dcb6a3 Add spec to RelativeLinkFilter for Unicode filenames 2015-07-30 17:25:07 -04:00
Hiroyuki Sato 1cd2860065 Fix the image file that contains non-ascii character is not displayed 2015-07-27 16:18:12 +09:00
Dmitriy Zaporozhets 79aac2c128 Merge branch 'ignore-references' into 'master'
Don't notify users mentioned in code blocks or blockquotes.

cc @rspeicher

See merge request !753
2015-06-02 18:39:18 +00:00
Robert Speicher 9e7a9c63a5 Further limit the limited whitelist for project/group descriptions 2015-06-02 13:41:12 -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
Douwe Maan 94919c7ef6 Ignore references in blockquotes. 2015-06-02 13:17:21 +02: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 5a9c5520d9 Make use of to_reference in more specs 2015-05-26 15:49:22 -04:00
Robert Speicher 81a09bc74c Support only double quotes for multi-word label references 2015-05-26 15:49:20 -04:00
Robert Speicher b88da58cb6 Add reference_pattern to Referable models 2015-05-26 15:48:32 -04:00
Robert Speicher 9d032cddf5 Correct the ReferenceFilter html/pipeline/filter require 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 212fe14c65 Customize the sanitization whitelist only once
Fixes #1651
2015-05-20 21:16:11 -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 b3276661f7 RelativeLinkFilter: refactor according to suggestions by @tsigo 2015-05-11 20:43:18 +02:00
Jakub Jirutka f7adac87fe Extract handling of relative file links to RelativeLinkFilter 2015-05-11 02:07:26 +02:00
Robert Speicher 70bbf093aa Remove class and id attributes from SanitizationFilter whitelist 2015-05-08 12:31:34 -04:00
Robert Speicher cca28c7920 Update Markdown help docs for latest changes 2015-05-06 21:04:33 -04:00
Robert Speicher 84a7675ea6 Remove title_for_issue helper 2015-04-30 17:27:33 -04:00
Robert Speicher 242bebc134 Remove special handling for the &#39; problem
While `escape_once` will create this HTML entity, Nokogiri always
translates it back before it gets to IssueReferenceFilter, so there
should be no danger of erroneous issue links.
2015-04-30 16:35:27 -04:00
Robert Speicher 0027c2ddd7 Add Project#get_issue 2015-04-30 16:35:27 -04:00
Robert Speicher 466bec7caa Rename SCHEME_PATTERN to LINK_PATTERN 2015-04-30 16:35:27 -04:00
Robert Speicher cd3c24a8f3 Autolink short URLs 2015-04-30 16:35:27 -04:00
Robert Speicher 50f707e27a Update Autolink SCHEME_PATTERN 2015-04-30 16:35:26 -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
Robert Speicher aa2cc670fe Add Gitlab::Markdown::AutolinkFilter 2015-04-30 16:35:25 -04:00
Robert Speicher 382a0aa6ef Add Gitlab::Markdown::TableOfContentsFilter
Removes header and table of contents processing from Redcarpet renderer.
2015-04-30 16:35:25 -04:00
Robert Speicher a64b5e3c60 Convert UserReferenceFilter#link_to_group to use a guard clause 2015-04-25 21:26:43 -04:00
Robert Speicher 92783eae2b Refactor UserReferenceFilter#user_link_filter 2015-04-25 18:07:20 -04:00
Robert Speicher 9d3a1d0054 Fix docs for push_result
[ci skip]
2015-04-25 17:44:24 -04:00
Robert Speicher 07a88040a4 Fix NotificationService spec 2015-04-25 16:46:06 -04:00
Robert Speicher 95ca6584d8 Add CommitRange directly to results Hash 2015-04-25 14:46:06 -04:00
Robert Speicher c0a97d70ef Don't allow nil references to get added to results 2015-04-25 14:41:06 -04:00