geothird-html-pipeline 0.0.12
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 +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +13 -0
- data/CHANGELOG.md +43 -0
- data/Gemfile +9 -0
- data/LICENSE +22 -0
- data/README.md +274 -0
- data/Rakefile +11 -0
- data/bin/html-pipeline +80 -0
- data/geothird-html-pipeline.gemspec +27 -0
- data/lib/html/pipeline.rb +198 -0
- data/lib/html/pipeline/@mention_filter.rb +121 -0
- data/lib/html/pipeline/absolute_source_filter.rb +48 -0
- data/lib/html/pipeline/autolink_filter.rb +22 -0
- data/lib/html/pipeline/body_content.rb +42 -0
- data/lib/html/pipeline/camo_filter.rb +70 -0
- data/lib/html/pipeline/email_reply_filter.rb +56 -0
- data/lib/html/pipeline/emoji_filter.rb +54 -0
- data/lib/html/pipeline/filter.rb +178 -0
- data/lib/html/pipeline/https_filter.rb +13 -0
- data/lib/html/pipeline/image_max_width_filter.rb +37 -0
- data/lib/html/pipeline/markdown_filter.rb +29 -0
- data/lib/html/pipeline/plain_text_input_filter.rb +11 -0
- data/lib/html/pipeline/sanitization_filter.rb +105 -0
- data/lib/html/pipeline/syntax_highlight_filter.rb +33 -0
- data/lib/html/pipeline/text_filter.rb +14 -0
- data/lib/html/pipeline/textile_filter.rb +21 -0
- data/lib/html/pipeline/toc_filter.rb +28 -0
- data/lib/html/pipeline/version.rb +5 -0
- data/test/helpers/mocked_instrumentation_service.rb +17 -0
- data/test/html/pipeline/absolute_source_filter_test.rb +56 -0
- data/test/html/pipeline/autolink_filter_test.rb +22 -0
- data/test/html/pipeline/camo_filter_test.rb +47 -0
- data/test/html/pipeline/emoji_filter_test.rb +18 -0
- data/test/html/pipeline/image_max_width_filter_test.rb +50 -0
- data/test/html/pipeline/markdown_filter_test.rb +101 -0
- data/test/html/pipeline/mention_filter_test.rb +156 -0
- data/test/html/pipeline/plain_text_input_filter_test.rb +22 -0
- data/test/html/pipeline/sanitization_filter_test.rb +47 -0
- data/test/html/pipeline/toc_filter_test.rb +47 -0
- data/test/html/pipeline_test.rb +74 -0
- data/test/test_helper.rb +38 -0
- metadata +213 -0
@@ -0,0 +1,156 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class HTML::Pipeline::MentionFilterTest < Test::Unit::TestCase
|
4
|
+
def filter(html, base_url='/', info_url=nil)
|
5
|
+
HTML::Pipeline::MentionFilter.call(html, :base_url => base_url, :info_url => info_url)
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_filtering_a_documentfragment
|
9
|
+
body = "<p>@kneath: check it out.</p>"
|
10
|
+
doc = Nokogiri::HTML::DocumentFragment.parse(body)
|
11
|
+
|
12
|
+
res = filter(doc, '/')
|
13
|
+
assert_same doc, res
|
14
|
+
|
15
|
+
link = "<a href=\"/kneath\" class=\"user-mention\">@kneath</a>"
|
16
|
+
assert_equal "<p>#{link}: check it out.</p>",
|
17
|
+
res.to_html
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_filtering_plain_text
|
21
|
+
body = "<p>@kneath: check it out.</p>"
|
22
|
+
res = filter(body, '/')
|
23
|
+
|
24
|
+
link = "<a href=\"/kneath\" class=\"user-mention\">@kneath</a>"
|
25
|
+
assert_equal "<p>#{link}: check it out.</p>",
|
26
|
+
res.to_html
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_not_replacing_mentions_in_pre_tags
|
30
|
+
body = "<pre>@kneath: okay</pre>"
|
31
|
+
assert_equal body, filter(body).to_html
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_not_replacing_mentions_in_code_tags
|
35
|
+
body = "<p><code>@kneath:</code> okay</p>"
|
36
|
+
assert_equal body, filter(body).to_html
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_not_replacing_mentions_in_links
|
40
|
+
body = "<p><a>@kneath</a> okay</p>"
|
41
|
+
assert_equal body, filter(body).to_html
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_entity_encoding_and_whatnot
|
45
|
+
body = "<p>@kneath what's up</p>"
|
46
|
+
link = "<a href=\"/kneath\" class=\"user-mention\">@kneath</a>"
|
47
|
+
assert_equal "<p>#{link} what's up</p>", filter(body, '/').to_html
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_html_injection
|
51
|
+
body = "<p>@kneath <script>alert(0)</script></p>"
|
52
|
+
link = "<a href=\"/kneath\" class=\"user-mention\">@kneath</a>"
|
53
|
+
assert_equal "<p>#{link} <script>alert(0)</script></p>",
|
54
|
+
filter(body, '/').to_html
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_links_to_nothing_when_no_info_url_given
|
58
|
+
body = "<p>How do I @mention someone?</p>"
|
59
|
+
assert_equal "<p>How do I @mention someone?</p>",
|
60
|
+
filter(body, '/').to_html
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_links_to_more_info_when_info_url_given
|
64
|
+
body = "<p>How do I @mention someone?</p>"
|
65
|
+
link = "<a href=\"https://github.com/blog/821\" class=\"user-mention\">@mention</a>"
|
66
|
+
assert_equal "<p>How do I #{link} someone?</p>",
|
67
|
+
filter(body, '/', 'https://github.com/blog/821').to_html
|
68
|
+
end
|
69
|
+
|
70
|
+
MarkdownPipeline =
|
71
|
+
HTML::Pipeline.new [
|
72
|
+
HTML::Pipeline::MarkdownFilter,
|
73
|
+
HTML::Pipeline::MentionFilter
|
74
|
+
]
|
75
|
+
|
76
|
+
def mentioned_usernames
|
77
|
+
result = {}
|
78
|
+
MarkdownPipeline.call(@body, {}, result)
|
79
|
+
result[:mentioned_usernames]
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_matches_usernames_in_body
|
83
|
+
@body = "@test how are you?"
|
84
|
+
assert_equal %w[test], mentioned_usernames
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_matches_usernames_with_dashes
|
88
|
+
@body = "hi @some-user"
|
89
|
+
assert_equal %w[some-user], mentioned_usernames
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_matches_usernames_followed_by_a_single_dot
|
93
|
+
@body = "okay @some-user."
|
94
|
+
assert_equal %w[some-user], mentioned_usernames
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_matches_usernames_followed_by_multiple_dots
|
98
|
+
@body = "okay @some-user..."
|
99
|
+
assert_equal %w[some-user], mentioned_usernames
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_does_not_match_email_addresses
|
103
|
+
@body = "aman@tmm1.net"
|
104
|
+
assert_equal [], mentioned_usernames
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_does_not_match_domain_name_looking_things
|
108
|
+
@body = "we need a @github.com email"
|
109
|
+
assert_equal [], mentioned_usernames
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_does_not_match_organization_team_mentions
|
113
|
+
@body = "we need to @github/enterprise know"
|
114
|
+
assert_equal [], mentioned_usernames
|
115
|
+
end
|
116
|
+
|
117
|
+
def test_matches_colon_suffixed_names
|
118
|
+
@body = "@tmm1: what do you think?"
|
119
|
+
assert_equal %w[tmm1], mentioned_usernames
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_matches_list_of_names
|
123
|
+
@body = "@defunkt @atmos @kneath"
|
124
|
+
assert_equal %w[defunkt atmos kneath], mentioned_usernames
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_matches_list_of_names_with_commas
|
128
|
+
@body = "/cc @defunkt, @atmos, @kneath"
|
129
|
+
assert_equal %w[defunkt atmos kneath], mentioned_usernames
|
130
|
+
end
|
131
|
+
|
132
|
+
def test_matches_inside_brackets
|
133
|
+
@body = "(@mislav) and [@rtomayko]"
|
134
|
+
assert_equal %w[mislav rtomayko], mentioned_usernames
|
135
|
+
end
|
136
|
+
|
137
|
+
def test_doesnt_ignore_invalid_users
|
138
|
+
@body = "@defunkt @mojombo and @somedude"
|
139
|
+
assert_equal ['defunkt', 'mojombo', 'somedude'], mentioned_usernames
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_returns_distinct_set
|
143
|
+
@body = "/cc @defunkt, @atmos, @kneath, @defunkt, @defunkt"
|
144
|
+
assert_equal %w[defunkt atmos kneath], mentioned_usernames
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_does_not_match_inline_code_block_with_multiple_code_blocks
|
148
|
+
@body = "something\n\n`/cc @defunkt @atmos @kneath` `/cc @atmos/atmos`"
|
149
|
+
assert_equal %w[], mentioned_usernames
|
150
|
+
end
|
151
|
+
|
152
|
+
def test_mention_at_end_of_parenthetical_sentence
|
153
|
+
@body = "(We're talking 'bout @ymendel.)"
|
154
|
+
assert_equal %w[ymendel], mentioned_usernames
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class HTML::Pipeline::PlainTextInputFilterTest < Test::Unit::TestCase
|
4
|
+
PlainTextInputFilter = HTML::Pipeline::PlainTextInputFilter
|
5
|
+
|
6
|
+
def test_fails_when_given_a_documentfragment
|
7
|
+
body = "<p>heyo</p>"
|
8
|
+
doc = Nokogiri::HTML::DocumentFragment.parse(body)
|
9
|
+
assert_raise(TypeError) { PlainTextInputFilter.call(doc, {}) }
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_wraps_input_in_a_div_element
|
13
|
+
doc = PlainTextInputFilter.call("howdy pahtner", {})
|
14
|
+
assert_equal "<div>howdy pahtner</div>", doc.to_s
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_html_escapes_plain_text_input
|
18
|
+
doc = PlainTextInputFilter.call("See: <http://example.org>", {})
|
19
|
+
assert_equal "<div>See: <http://example.org></div>",
|
20
|
+
doc.to_s
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class HTML::Pipeline::SanitizationFilterTest < Test::Unit::TestCase
|
4
|
+
SanitizationFilter = HTML::Pipeline::SanitizationFilter
|
5
|
+
|
6
|
+
def test_removing_script_tags
|
7
|
+
orig = %(<p><img src="http://github.com/img.png" /><script></script></p>)
|
8
|
+
html = SanitizationFilter.call(orig).to_s
|
9
|
+
assert_no_match /script/, html
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_removing_style_tags
|
13
|
+
orig = %(<p><style>hey now</style></p>)
|
14
|
+
html = SanitizationFilter.call(orig).to_s
|
15
|
+
assert_no_match /style/, html
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_removing_style_attributes
|
19
|
+
orig = %(<p style='font-size:1000%'>YO DAWG</p>)
|
20
|
+
html = SanitizationFilter.call(orig).to_s
|
21
|
+
assert_no_match /font-size/, html
|
22
|
+
assert_no_match /style/, html
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_removing_script_event_handler_attributes
|
26
|
+
orig = %(<a onclick='javascript:alert(0)'>YO DAWG</a>)
|
27
|
+
html = SanitizationFilter.call(orig).to_s
|
28
|
+
assert_no_match /javscript/, html
|
29
|
+
assert_no_match /onclick/, html
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_sanitizes_li_elements_not_contained_in_ul_or_ol
|
33
|
+
stuff = "a\n<li>b</li>\nc"
|
34
|
+
html = SanitizationFilter.call(stuff).to_s
|
35
|
+
assert_equal "a\nb\nc", html
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_does_not_sanitize_li_elements_contained_in_ul_or_ol
|
39
|
+
stuff = "a\n<ul><li>b</li></ul>\nc"
|
40
|
+
assert_equal stuff, SanitizationFilter.call(stuff).to_s
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_github_specific_protocols_are_not_removed
|
44
|
+
stuff = '<a href="github-windows://spillthelog">Spill this yo</a> and so on'
|
45
|
+
assert_equal stuff, SanitizationFilter.call(stuff).to_s
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class HTML::Pipeline::TableOfContentsFilterTest < Test::Unit::TestCase
|
4
|
+
TocFilter = HTML::Pipeline::TableOfContentsFilter
|
5
|
+
|
6
|
+
def test_anchors_are_added_properly
|
7
|
+
orig = %(<h1>Ice cube</h1><p>Will swarm on any motherfucker in a blue uniform</p>)
|
8
|
+
assert_includes '<a name=', TocFilter.call(orig).to_s
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_anchors_have_sane_names
|
12
|
+
orig = %(<h1>Dr Dre</h1><h1>Ice Cube</h1><h1>Eazy-E</h1><h1>MC Ren</h1>)
|
13
|
+
result = TocFilter.call(orig).to_s
|
14
|
+
|
15
|
+
assert_includes '"dr-dre"', result
|
16
|
+
assert_includes '"ice-cube"', result
|
17
|
+
assert_includes '"eazy-e"', result
|
18
|
+
assert_includes '"mc-ren"', result
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_dupe_headers_have_unique_trailing_identifiers
|
22
|
+
orig = %(<h1>Straight Outta Compton</h1>
|
23
|
+
<h2>Dopeman</h2>
|
24
|
+
<h3>Express Yourself</h3>
|
25
|
+
<h1>Dopeman</h1>)
|
26
|
+
|
27
|
+
result = TocFilter.call(orig).to_s
|
28
|
+
|
29
|
+
assert_includes '"dopeman"', result
|
30
|
+
assert_includes '"dopeman-1"', result
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_all_header_tags_are_found_when_adding_anchors
|
34
|
+
orig = %(<h1>"Funky President" by James Brown</h1>
|
35
|
+
<h2>"It's My Thing" by Marva Whitney</h2>
|
36
|
+
<h3>"Boogie Back" by Roy Ayers</h3>
|
37
|
+
<h4>"Feel Good" by Fancy</h4>
|
38
|
+
<h5>"Funky Drummer" by James Brown</h5>
|
39
|
+
<h6>"Ruthless Villain" by Eazy-E</h6>
|
40
|
+
<h7>"Be Thankful for What You Got" by William DeVaughn</h7>)
|
41
|
+
|
42
|
+
doc = TocFilter.call(orig)
|
43
|
+
assert_equal 6, doc.search('a').size
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
require "helpers/mocked_instrumentation_service"
|
3
|
+
|
4
|
+
class HTML::PipelineTest < Test::Unit::TestCase
|
5
|
+
Pipeline = HTML::Pipeline
|
6
|
+
class TestFilter
|
7
|
+
def self.call(input, context, result)
|
8
|
+
input.reverse
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def setup
|
13
|
+
@context = {}
|
14
|
+
@result_class = Hash
|
15
|
+
@pipeline = Pipeline.new [TestFilter], @context, @result_class
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_filter_instrumentation
|
19
|
+
service = MockedInstrumentationService.new
|
20
|
+
events = service.subscribe "call_filter.html_pipeline"
|
21
|
+
@pipeline.instrumentation_service = service
|
22
|
+
filter(body = "hello")
|
23
|
+
event, payload, res = events.pop
|
24
|
+
assert event, "event expected"
|
25
|
+
assert_equal "call_filter.html_pipeline", event
|
26
|
+
assert_equal TestFilter.name, payload[:filter]
|
27
|
+
assert_equal @pipeline.class.name, payload[:pipeline]
|
28
|
+
assert_equal body.reverse, payload[:result][:output]
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_pipeline_instrumentation
|
32
|
+
service = MockedInstrumentationService.new
|
33
|
+
events = service.subscribe "call_pipeline.html_pipeline"
|
34
|
+
@pipeline.instrumentation_service = service
|
35
|
+
filter(body = "hello")
|
36
|
+
event, payload, res = events.pop
|
37
|
+
assert event, "event expected"
|
38
|
+
assert_equal "call_pipeline.html_pipeline", event
|
39
|
+
assert_equal @pipeline.filters.map(&:name), payload[:filters]
|
40
|
+
assert_equal @pipeline.class.name, payload[:pipeline]
|
41
|
+
assert_equal body.reverse, payload[:result][:output]
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_default_instrumentation_service
|
45
|
+
service = 'default'
|
46
|
+
Pipeline.default_instrumentation_service = service
|
47
|
+
pipeline = Pipeline.new [], @context, @result_class
|
48
|
+
assert_equal service, pipeline.instrumentation_service
|
49
|
+
ensure
|
50
|
+
Pipeline.default_instrumentation_service = nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_setup_instrumentation
|
54
|
+
assert_nil @pipeline.instrumentation_service
|
55
|
+
|
56
|
+
service = MockedInstrumentationService.new
|
57
|
+
events = service.subscribe "call_pipeline.html_pipeline"
|
58
|
+
@pipeline.setup_instrumentation name = 'foo', service
|
59
|
+
|
60
|
+
assert_equal service, @pipeline.instrumentation_service
|
61
|
+
assert_equal name, @pipeline.instrumentation_name
|
62
|
+
|
63
|
+
filter(body = 'foo')
|
64
|
+
|
65
|
+
event, payload, res = events.pop
|
66
|
+
assert event, "expected event"
|
67
|
+
assert_equal name, payload[:pipeline]
|
68
|
+
assert_equal body.reverse, payload[:result][:output]
|
69
|
+
end
|
70
|
+
|
71
|
+
def filter(input)
|
72
|
+
@pipeline.call(input)
|
73
|
+
end
|
74
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'html/pipeline'
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
require 'active_support/core_ext/object/try'
|
6
|
+
|
7
|
+
module TestHelpers
|
8
|
+
# Asserts that `needle` is not a member of `haystack`, where
|
9
|
+
# `haystack` is any object that responds to `include?`.
|
10
|
+
def assert_doesnt_include(needle, haystack, message = nil)
|
11
|
+
error = '<?> included in <?>'
|
12
|
+
message = build_message(message, error, needle.to_s, Array(haystack).map(&:to_s))
|
13
|
+
|
14
|
+
assert_block message do
|
15
|
+
!haystack.include?(needle)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# Asserts that `needle` is a member of `haystack`, where
|
20
|
+
# `haystack` is any object that responds to `include?`.
|
21
|
+
def assert_includes(needle, haystack, message = nil)
|
22
|
+
error = '<?> not included in <?>'
|
23
|
+
message = build_message(message, error, needle.to_s, Array(haystack).map(&:to_s))
|
24
|
+
|
25
|
+
assert_block message do
|
26
|
+
haystack.include?(needle)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Asserts that two html fragments are equivalent. Attribute order
|
31
|
+
# will be ignored.
|
32
|
+
def assert_equal_html(expected, actual)
|
33
|
+
assert_equal Nokogiri::HTML::DocumentFragment.parse(expected).to_hash,
|
34
|
+
Nokogiri::HTML::DocumentFragment.parse(actual).to_hash
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
Test::Unit::TestCase.send(:include, TestHelpers)
|
metadata
ADDED
@@ -0,0 +1,213 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: geothird-html-pipeline
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.12
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Tomayko
|
8
|
+
- Jerry Cheung
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gemoji
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: nokogiri
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.4'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.4'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: github-markdown
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0.5'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0.5'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: sanitize
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '2.0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rinku
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.7'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '1.7'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: escape_utils
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0.3'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ~>
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0.3'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: activesupport
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '2'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '2'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: geothird-linguist
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ~>
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 2.6.8
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 2.6.8
|
126
|
+
description: GitHub HTML processing filters and utilities
|
127
|
+
email:
|
128
|
+
- ryan@github.com
|
129
|
+
- jerry@github.com
|
130
|
+
executables: []
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- .gitignore
|
135
|
+
- .travis.yml
|
136
|
+
- CHANGELOG.md
|
137
|
+
- Gemfile
|
138
|
+
- LICENSE
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- bin/html-pipeline
|
142
|
+
- geothird-html-pipeline.gemspec
|
143
|
+
- lib/html/pipeline.rb
|
144
|
+
- lib/html/pipeline/@mention_filter.rb
|
145
|
+
- lib/html/pipeline/absolute_source_filter.rb
|
146
|
+
- lib/html/pipeline/autolink_filter.rb
|
147
|
+
- lib/html/pipeline/body_content.rb
|
148
|
+
- lib/html/pipeline/camo_filter.rb
|
149
|
+
- lib/html/pipeline/email_reply_filter.rb
|
150
|
+
- lib/html/pipeline/emoji_filter.rb
|
151
|
+
- lib/html/pipeline/filter.rb
|
152
|
+
- lib/html/pipeline/https_filter.rb
|
153
|
+
- lib/html/pipeline/image_max_width_filter.rb
|
154
|
+
- lib/html/pipeline/markdown_filter.rb
|
155
|
+
- lib/html/pipeline/plain_text_input_filter.rb
|
156
|
+
- lib/html/pipeline/sanitization_filter.rb
|
157
|
+
- lib/html/pipeline/syntax_highlight_filter.rb
|
158
|
+
- lib/html/pipeline/text_filter.rb
|
159
|
+
- lib/html/pipeline/textile_filter.rb
|
160
|
+
- lib/html/pipeline/toc_filter.rb
|
161
|
+
- lib/html/pipeline/version.rb
|
162
|
+
- test/helpers/mocked_instrumentation_service.rb
|
163
|
+
- test/html/pipeline/absolute_source_filter_test.rb
|
164
|
+
- test/html/pipeline/autolink_filter_test.rb
|
165
|
+
- test/html/pipeline/camo_filter_test.rb
|
166
|
+
- test/html/pipeline/emoji_filter_test.rb
|
167
|
+
- test/html/pipeline/image_max_width_filter_test.rb
|
168
|
+
- test/html/pipeline/markdown_filter_test.rb
|
169
|
+
- test/html/pipeline/mention_filter_test.rb
|
170
|
+
- test/html/pipeline/plain_text_input_filter_test.rb
|
171
|
+
- test/html/pipeline/sanitization_filter_test.rb
|
172
|
+
- test/html/pipeline/toc_filter_test.rb
|
173
|
+
- test/html/pipeline_test.rb
|
174
|
+
- test/test_helper.rb
|
175
|
+
homepage: https://github.com/jch/html-pipeline
|
176
|
+
licenses:
|
177
|
+
- MIT
|
178
|
+
metadata: {}
|
179
|
+
post_install_message:
|
180
|
+
rdoc_options: []
|
181
|
+
require_paths:
|
182
|
+
- lib
|
183
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - '>='
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
requirements: []
|
194
|
+
rubyforge_project:
|
195
|
+
rubygems_version: 2.0.0
|
196
|
+
signing_key:
|
197
|
+
specification_version: 4
|
198
|
+
summary: Helpers for processing content through a chain of filters
|
199
|
+
test_files:
|
200
|
+
- test/helpers/mocked_instrumentation_service.rb
|
201
|
+
- test/html/pipeline/absolute_source_filter_test.rb
|
202
|
+
- test/html/pipeline/autolink_filter_test.rb
|
203
|
+
- test/html/pipeline/camo_filter_test.rb
|
204
|
+
- test/html/pipeline/emoji_filter_test.rb
|
205
|
+
- test/html/pipeline/image_max_width_filter_test.rb
|
206
|
+
- test/html/pipeline/markdown_filter_test.rb
|
207
|
+
- test/html/pipeline/mention_filter_test.rb
|
208
|
+
- test/html/pipeline/plain_text_input_filter_test.rb
|
209
|
+
- test/html/pipeline/sanitization_filter_test.rb
|
210
|
+
- test/html/pipeline/toc_filter_test.rb
|
211
|
+
- test/html/pipeline_test.rb
|
212
|
+
- test/test_helper.rb
|
213
|
+
has_rdoc:
|