html-pipeline-gitlab 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec56d178f768c798fd09c596db66f6f59e11331d
4
- data.tar.gz: a95a720b964bf9674df6f904937e8824259b93b8
3
+ metadata.gz: c7a7dd1ca2a6beda55cabf4a77b28ff0e53e9be1
4
+ data.tar.gz: 02a41c9b95cb8904b6d8cccfdc5612e91a701173
5
5
  SHA512:
6
- metadata.gz: 90e2fcd6e682be6a6a8aa5de30b371408c888fb988cfae793a25a68ab1e776a25eb41b42c1c7379ace08c82d60c15e0754faf42588593c14faa36090f6f82850
7
- data.tar.gz: b3388bf257ff5405ec68008aac92fa018fd9e28bd42ce840172297781f62ed7c1efae8608466241a7392d7bd3531249aea52be19309f35f23a2989ae33a8fbe8
6
+ metadata.gz: 6adebd58657357f20b7d9ae229aba43f6de7dbd0144188c3c82332100ea86eea55bf69b8212cf4ad155c1678eaad21e2cd403f0cde1dcf0bb262fa0c15c36273
7
+ data.tar.gz: ef0b0ce4974d20960646199cb9729f078ded31e2d1c0bab54baacf7f443364a420ec7321fb6209d1bb0578a0e90c04dae32ccc3b334ee7c238563732bb73d089
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v 0.1.1
2
+ - Add sanitization filter to markdown pipeline
3
+
1
4
  v 0.1.0
2
5
  - Initial public release
3
6
  - Add GitlabEmoji filter
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_runtime_dependency 'html-pipeline', '~> 1.11.0'
25
25
  spec.add_runtime_dependency 'gitlab_emoji', '~> 0.0.1.1'
26
+ spec.add_runtime_dependency 'sanitize', '~> 3.0.2'
26
27
  end
@@ -1,16 +1,19 @@
1
1
  require 'html/pipeline'
2
2
  require 'html/pipeline/gitlab/version'
3
- require 'html/pipeline/gitlab/gitlab_emoji_filter'
4
3
 
5
4
  module HTML
6
5
  class Pipeline
7
- class Gitlab
6
+ class GitLab
8
7
  # GitLab related filters for html-pipeline. Implements new filters used
9
8
  # by GitLab.
10
9
 
11
- # Most used markdown pipeline in GitLab. Performs emoji replace,,ent
10
+ # Custom filter implementations
11
+ autoload :GitLabEmojiFilter, 'html/pipeline/gitlab/gitlab_emoji_filter'
12
+
13
+ # Most used markdown pipeline in GitLab. Performs emoji replacement.
12
14
  MarkdownPipeline = HTML::Pipeline.new [
13
- HTML::Pipeline::GitLab::GitLabEmojiFilter
15
+ SanitizationFilter,
16
+ GitLabEmojiFilter
14
17
  ]
15
18
  end
16
19
  end
@@ -1,7 +1,7 @@
1
1
  module Html
2
2
  module Pipeline
3
3
  module Gitlab
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
7
7
  end
@@ -3,7 +3,7 @@ require 'html/pipeline/gitlab'
3
3
 
4
4
  class HTML::Pipeline::GitLabEmojiFilterTest < Minitest::Test
5
5
  GitLabEmojiFilter = HTML::Pipeline::GitLab::GitLabEmojiFilter
6
-
6
+
7
7
  def test_emojify
8
8
  filter = GitLabEmojiFilter.new('<p>:heart:</p>', {asset_root: 'https://foo.com'})
9
9
  doc = filter.call
@@ -16,16 +16,16 @@ class HTML::Pipeline::GitLabEmojiFilterTest < Minitest::Test
16
16
  doc = filter.call
17
17
  assert_match block, doc.to_html
18
18
  end
19
-
19
+
20
20
  def test_uri_encoding
21
21
  filter = GitLabEmojiFilter.new('<p>:+1:</p>', {asset_root: 'https://foo.com'})
22
22
  doc = filter.call
23
23
  assert_match 'https://foo.com/emoji/%2B1.png', doc.search('img').attr('src').value
24
24
  end
25
-
25
+
26
26
  def test_required_context_validation
27
- exception = assert_raises(ArgumentError) {
28
- GitLabEmojiFilter.call("", {})
27
+ exception = assert_raises(ArgumentError) {
28
+ GitLabEmojiFilter.call("", {})
29
29
  }
30
30
  assert_match /:asset_root/, exception.message
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-pipeline-gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Schilling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-25 00:00:00.000000000 Z
11
+ date: 2014-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.0.1.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: sanitize
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 3.0.2
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 3.0.2
69
83
  description: Extension filters for html-pipeline used by GitLab
70
84
  email:
71
85
  - schilling.ro@gmail.com