Skip to content

Commit 095cb2d

Browse files
authored
Merge pull request #2061 from github/dependabot/bundler/html-pipeline-3.2.4
chore(deps): update html-pipeline requirement from ~> 1.0 to ~> 3.2
2 parents 8a31006 + dea1788 commit 095cb2d

16 files changed

Lines changed: 345 additions & 534 deletions

Gemfile.lock

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ GEM
3535
commonmarker (2.8.2-x86_64-linux)
3636
concurrent-ruby (1.3.6)
3737
connection_pool (3.0.2)
38-
crass (1.0.6)
3938
creole (0.5.0)
4039
date (3.5.1)
4140
docile (1.4.1)
@@ -47,9 +46,9 @@ GEM
4746
charlock_holmes (~> 0.7.7)
4847
mini_mime (~> 1.0)
4948
rugged (~> 1.0)
50-
html-pipeline (1.11.0)
51-
activesupport (>= 2)
52-
nokogiri (~> 1.4)
49+
html-pipeline (3.2.4)
50+
selma (~> 0.4)
51+
zeitwerk (~> 2.5)
5352
htmlentities (4.3.4)
5453
i18n (1.14.8)
5554
concurrent-ruby (~> 1.0)
@@ -95,10 +94,14 @@ GEM
9594
rexml (3.4.4)
9695
rubypants (0.7.1)
9796
rugged (1.9.0)
98-
sanitize (6.1.3)
99-
crass (~> 1.0.2)
100-
nokogiri (>= 1.12.0)
10197
securerandom (0.4.1)
98+
selma (0.5.0)
99+
rb_sys (~> 0.9)
100+
selma (0.5.0-aarch64-linux)
101+
selma (0.5.0-arm-linux)
102+
selma (0.5.0-arm64-darwin)
103+
selma (0.5.0-x86_64-darwin)
104+
selma (0.5.0-x86_64-linux)
102105
simplecov (0.22.0)
103106
docile (~> 1.1)
104107
simplecov-html (~> 0.11)
@@ -122,6 +125,7 @@ GEM
122125
htmlentities
123126
nokogiri
124127
twitter-text
128+
zeitwerk (2.8.2)
125129

126130
PLATFORMS
127131
aarch64-linux
@@ -139,7 +143,7 @@ DEPENDENCIES
139143
creole (~> 0.5.0)
140144
github-linguist (>= 7.1.3)
141145
github-markup!
142-
html-pipeline (~> 1.0)
146+
html-pipeline (~> 3.2)
143147
kramdown
144148
minitest (~> 6.0, >= 5.4.3)
145149
nokogiri (~> 1.19.2)
@@ -149,7 +153,6 @@ DEPENDENCIES
149153
rdoc (~> 7.2.0)
150154
redcarpet
151155
rexml
152-
sanitize (>= 4.6.3)
153156
simplecov (~> 0.22)
154157
twitter-text (~> 1.14)
155158
wikicloth (= 0.8.3)

github-markup.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Gem::Specification.new do |s|
2626
s.add_development_dependency 'rake', '~> 13'
2727
s.add_development_dependency 'activesupport', '~> 8.1.3'
2828
s.add_development_dependency 'minitest', '>= 5.4.3', '~> 6.0'
29-
s.add_development_dependency 'html-pipeline', '~> 1.0'
30-
s.add_development_dependency 'sanitize', '>= 4.6.3'
29+
s.add_development_dependency 'html-pipeline', '~> 3.2'
3130
s.add_development_dependency 'nokogiri', '~> 1.19.2'
3231
s.add_development_dependency 'nokogiri-diff', '~> 0.3.0'
3332
s.add_development_dependency "github-linguist", ">= 7.1.3"

test/markup_test.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
require 'github-markup'
77
require 'github/markup'
88
require 'minitest/autorun'
9-
require 'html/pipeline'
9+
require 'html_pipeline'
1010
require 'nokogiri'
1111
require 'nokogiri/diff'
1212

@@ -36,17 +36,17 @@ def assert_html_equal(expected, actual, msg = nil)
3636
end
3737

3838
class MarkupTest < Minitest::Test
39-
class MarkupFilter < HTML::Pipeline::Filter
40-
def call
41-
filename = context[:filename]
39+
class MarkupFilter < HTMLPipeline::ConvertFilter
40+
def call(_text, context: {})
41+
filename = context[:filename] || @context[:filename]
4242
GitHub::Markup.render(filename, File.read(filename)).strip.force_encoding("utf-8")
4343
end
4444
end
4545

46-
Pipeline = HTML::Pipeline.new [
47-
MarkupFilter,
48-
HTML::Pipeline::SanitizationFilter
49-
]
46+
Pipeline = HTMLPipeline.new(
47+
convert_filter: MarkupFilter.new,
48+
sanitization_config: HTMLPipeline::SanitizationFilter::DEFAULT_CONFIG
49+
)
5050

5151
Dir['test/markups/README.*'].each do |readme|
5252
next if readme =~ /html$/
@@ -57,7 +57,7 @@ def call
5757
source = File.read(readme)
5858
expected_file = "#{readme}.html"
5959
expected = File.read(expected_file).rstrip
60-
actual = Pipeline.to_html(nil, :filename => readme)
60+
actual = Pipeline.call("", context: { filename: readme })[:output].to_s
6161

6262
if source != expected
6363
assert(source != actual, "#{markup} did not render anything")

test/markups/README.asciidoc.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1>Document Title</h1>
22
<div>
3-
<h2>First Section</h2>
3+
<h2 id="first-section">First Section</h2>
44
<div>
55
<div>
66
<ul>
@@ -16,12 +16,12 @@ <h2>First Section</h2>
1616
<p>Refer to <a href="#another-section">Another Section</a> or <a href="#another-section-1">Another Section</a>.</p>
1717
</div>
1818
<div>
19-
<p>Navigate from README.asciidoc to <a href="another-document.asciidoc">another document</a>.</p>
19+
<p>Navigate from README.asciidoc to <a>another document</a>.</p>
2020
</div>
2121
</div>
2222
</div>
2323
<div>
24-
<h2>Another Section</h2>
24+
<h2 id="another-section">Another Section</h2>
2525
<div>
2626
<div>
2727
<table>
@@ -43,17 +43,17 @@ <h2>Another Section</h2>
4343
<div>
4444
<ul>
4545
<li>
46-
<p> todo</p>
46+
<p>&#10063; todo</p>
4747
</li>
4848
<li>
49-
<p> done</p>
49+
<p>&#10003; done</p>
5050
</li>
5151
</ul>
5252
</div>
5353
</div>
5454
</div>
5555
<div>
56-
<h2>Another Section</h2>
56+
<h2 id="another-section-1">Another Section</h2>
5757
<div>
5858
<div>
5959
<p>content</p>

test/markups/README.creole.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
<h1>H1</h1><h2>H2</h2><p>paragraph of text that will be turned into a paragraph element. It can go over several lines with line breaks, it will be turned into a contiguous paragraph element.</p><p>You can force a linebreak in your paragraph text<br>thusly.</p><ul>
2-
<li>a list element<ul><li>sub list element</li></ul>
3-
</li>
4-
<li>2nd list element</li>
5-
</ul><pre>pre formatted text
1+
<h1>H1</h1><h2>H2</h2><p>paragraph of text that will be turned into a paragraph element. It can go over several lines with line breaks, it will be turned into a contiguous paragraph element.</p><p>You can force a linebreak in your paragraph text<br/>thusly.</p><ul><li>a list element<ul><li>sub list element</li></ul></li><li>2nd list element</li></ul><pre>pre formatted text
62

73
$ ls -la
84
total 56

test/markups/README.directives.rst.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ <h2>Introduction</h2>
3434
<pre>
3535
.. github display [on | off]
3636
</pre>
37-
<p>If you pass this the "on" value, then all unknown directives
37+
<p>If you pass this the &quot;on&quot; value, then all unknown directives
3838
will be displayed as literal code blocks. If you pass this
39-
the "off" value, then unknown directives will not be displayed.</p>
39+
the &quot;off&quot; value, then unknown directives will not be displayed.</p>
4040
<p>In addition to controlling the display of literal code blocks,
4141
this also allows you to show comments specifically for github.</p>
4242
<p>For example, somebody could place this at the top of their file:</p>

test/markups/README.litcoffee.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ <h2>Literate CoffeeScript Test</h2>
33
<p>Taken from <a href="https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee">https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee</a></p>
44
</blockquote>
55
<p>comment comment</p>
6-
<pre><code>test "basic literate CoffeeScript parsing", -&gt;
6+
<pre><code>test &quot;basic literate CoffeeScript parsing&quot;, -&gt;
77
ok yes
88
</code></pre>
99
<p>now with a...</p>
10-
<pre><code>test "broken up indentation", -&gt;
10+
<pre><code>test &quot;broken up indentation&quot;, -&gt;
1111
</code></pre>
1212
<p>... broken up ...</p>
1313
<pre><code> do -&gt;
@@ -16,14 +16,14 @@ <h2>Literate CoffeeScript Test</h2>
1616
<pre><code> ok yes
1717
</code></pre>
1818
<p>Code must be separated from text by a blank line.</p>
19-
<pre><code>test "code blocks must be preceded by a blank line", -&gt;
19+
<pre><code>test &quot;code blocks must be preceded by a blank line&quot;, -&gt;
2020
</code></pre>
2121
<p>The next line is part of the text and will not be executed.
2222
fail()</p>
2323
<pre><code> ok yes
2424
</code></pre>
2525
<p>Code in <code>backticks is not parsed</code> and...</p>
26-
<pre><code>test "comments in indented blocks work", -&gt;
26+
<pre><code>test &quot;comments in indented blocks work&quot;, -&gt;
2727
do -&gt;
2828
do -&gt;
2929
# Regular comment.
@@ -51,5 +51,5 @@ <h2>Literate CoffeeScript Test</h2>
5151
</li>
5252
</ul>
5353
<p>Tabs work too:</p>
54-
<p>test "tabbed code", -&gt;
54+
<p>test &quot;tabbed code&quot;, -&gt;
5555
ok yes</p>

0 commit comments

Comments
 (0)