Skip to content

Commit e7beefb

Browse files
zkoppertCopilot
andcommitted
test: regenerate fixtures for html-pipeline v3 sanitizer (Selma)
html-pipeline v3 replaces the v1 SanitizationFilter (Sanitize gem) with one backed by Selma. The default allowlist and serialization differ in observable but reasonable ways: * Heading/anchor IDs (e.g. <h2 id="first-section">) are now preserved, fixing TOC anchor links that v1 stripped silently. * <span id=...>, <div id=...>, and <caption> elements are preserved. * Bare-filename relative hrefs (<a href="rawr.html">) are dropped because Selma's :relative protocol matcher requires a leading ./, ../, or /. Absolute http(s) and root-relative links are unaffected. * Self-closing tags serialize as <br/> instead of <br>. * Non-ASCII glyphs in attribute-free text are emitted as numeric entities (\u274F -> &#10063;). These fixtures document representative pipeline output, not contracts the library itself enforces - real consumers build their own pipelines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Zack Koppert <zkoppert@github.com>
1 parent 635bd18 commit e7beefb

13 files changed

Lines changed: 323 additions & 514 deletions

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>

test/markups/README.long.rst.html

Lines changed: 194 additions & 336 deletions
Large diffs are not rendered by default.

test/markups/README.mediawiki.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<p><a href="Home">» JRuby Project Wiki Home Page</a>
2-
</p><h1>Embedding JRuby</h1>
1+
<p><a>» JRuby Project Wiki Home Page</a>
2+
<h1>Embedding JRuby</h1>
33
Using Java from Ruby is JRuby's best-known feature---but you can also go in the other direction, and use Ruby from Java. There are several different ways to do this. You can execute entire Ruby scripts, call individual Ruby methods, or even implement a Java interface in Ruby (thus allowing you to treat Ruby objects like Java ones). We refer to all these techniques generically as "embedding." This section will explain how to embed JRuby in your Java project.
4-
5-
<p></p><table summary="Contents"><tr><td>
6-
<div><h2>Table of Contents</h2></div>
4+
</p>
5+
<p><table id="toc" summary="Contents"><tr><td>
6+
<div id="toctitle"><h2>Table of Contents</h2></div>
77
<ul>
88
<li>
99
<a href="#Red_Bridge_JRuby_Embed">Red Bridge (JRuby Embed)</a><ul><li><a href="#Features_of_Red_Bridge">Features of Red Bridge</a></li></ul>
@@ -12,53 +12,53 @@
1212
<li><a href="#References">References</a></li>
1313
</ul>
1414
</td></tr></table>
15-
15+
</p>
1616

1717
<h1>
18-
<a name="Red_Bridge_JRuby_Embed"></a>Red Bridge (JRuby Embed)
18+
<a name="Red_Bridge_JRuby_Embed"></a><span id="Red_Bridge_JRuby_Embed">Red Bridge (JRuby Embed)</span>
1919
</h1>
2020

2121

2222

2323
<p><tt>one-&lt;two</tt>
24-
</p><pre>a-b</pre>
25-
26-
<p>JRuby has long had a private embedding API, which was closely tied to the runtime's internals and therefore changed frequently as JRuby evolved. Since version 1.4, however, we have also provided a more stable public API, known as Red Bridge or JRuby Embed. Existing Java programs written to the <a href="DirectJRubyEmbedding">legacy API</a> should still work, but we strongly recommend Red Bridge for all new projects.
24+
<pre>a-b</pre>
25+
</p>
26+
<p>JRuby has long had a private embedding API, which was closely tied to the runtime's internals and therefore changed frequently as JRuby evolved. Since version 1.4, however, we have also provided a more stable public API, known as Red Bridge or JRuby Embed. Existing Java programs written to the <a>legacy API</a> should still work, but we strongly recommend Red Bridge for all new projects.
2727
</p>
2828

2929
<h2>
30-
<a name="Features_of_Red_Bridge"></a>Features of Red Bridge
30+
<a name="Features_of_Red_Bridge"></a><span id="Features_of_Red_Bridge">Features of Red Bridge</span>
3131
</h2>
3232

3333

34-
<p>Red Bridge consists of two layers: Embed Core on the bottom, and implementations of <a href="http://www.jcp.org/en/jsr/detail?id=223" target="_blank">JSR223</a> and <a href="http://jakarta.apache.org/bsf/" target="_blank">BSF</a> on top. Embed Core is JRuby-specific, and can take advantage of much of JRuby's power. JSR223 and BSF are more general interfaces that provide a common ground across scripting languages.
34+
<p>Red Bridge consists of two layers: Embed Core on the bottom, and implementations of <a href="http://www.jcp.org/en/jsr/detail?id=223">JSR223</a> and <a href="http://jakarta.apache.org/bsf/">BSF</a> on top. Embed Core is JRuby-specific, and can take advantage of much of JRuby's power. JSR223 and BSF are more general interfaces that provide a common ground across scripting languages.
3535
</p>
3636
<p>Which API should you use? For projects where Ruby is the only scripting language involved, we recommend Embed Core for the following reasons:
3737
</p>
3838

3939

4040

41-
<p></p><ol>
41+
<p><ol>
4242
<li>With Embed Core, you can create several Ruby environments in one JVM, and configure them individually (via <code>org.jruby.RubyInstanceConfig</code>. With the other APIs, configuration options can only be set globally, via the <code>System</code> properties.</li>
4343
<li>Embed Core offers several shortcuts, such as loading scripts from a <code>java.io.InputStream</code>, or returning Java-friendly objects from Ruby code. These allow you to skip a lot of boilerplate.</li>
4444
</ol>
4545
For projects requiring multiple scripting languages, JSR223 is a good fit. Though the API is language-independent, JRuby's implementation of it allows you to set some Ruby-specific options. In particular, you can control the threading model of the scripting engine, the lifetime of local variables, compilation mode, and how line numbers are displayed.
46-
47-
<p>The full <a href="http://jruby-embed.kenai.com/docs/" target="_blank">API documentation</a> has all the gory details. It's worth talking about a couple of the finer points here.
46+
</p>
47+
<p>The full <a href="http://jruby-embed.kenai.com/docs/">API documentation</a> has all the gory details. It's worth talking about a couple of the finer points here.
4848
</p>
4949

5050
<h1>
51-
<a name="Previous_Embedding_JRuby_Page"></a>Previous Embedding JRuby Page
51+
<a name="Previous_Embedding_JRuby_Page"></a><span id="Previous_Embedding_JRuby_Page">Previous Embedding JRuby Page</span>
5252
</h1>
5353

5454

55-
<p>We recommend using Embed Core; however, if you're maintaining code that uses the old API, you can find its documentation on the <a href="JavaIntegration">legacy embedding</a><sup>[<a href="#cite_note-1">1</a>]</sup> page.
55+
<p>We recommend using Embed Core; however, if you're maintaining code that uses the old API, you can find its documentation on the <a>legacy embedding</a><sup id="cite_ref-1-0">[<a href="#cite_note-1">1</a>]</sup> page.
5656
</p>
5757

5858
<h1>
59-
<a name="References"></a>References
59+
<a name="References"></a><span id="References">References</span>
6060
</h1>
6161

6262

63-
<p></p><ol><li>
64-
<b><a href="#cite_ref-1-0">^</a> </b> This link goes nowhere.</li></ol>
63+
<p><ol><li id="cite_note-1">
64+
<b><a href="#cite_ref-1-0">^</a> </b> This link goes nowhere.</li></ol></p>

test/markups/README.org.html

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,38 @@
11
<h1>org-ruby</h1>
22
<table>
3-
<tr>
4-
<td>Status:</td>
5-
<td>Under Development</td>
6-
</tr>
7-
<tr>
8-
<td>Location:</td>
9-
<td><a href="http://github.com/wallyqs/org-ruby">http://github.com/wallyqs/org-ruby</a></td>
10-
</tr>
11-
<tr>
12-
<td>Version:</td>
13-
<td>0.9.0</td>
14-
</tr>
3+
<tr><td>Status:</td><td>Under Development</td></tr>
4+
<tr><td>Location:</td><td><a href="http://github.com/wallyqs/org-ruby">http://github.com/wallyqs/org-ruby</a></td></tr>
5+
<tr><td>Version:</td><td>0.9.0</td></tr>
156
</table>
16-
<h1>1 Description</h1>
7+
<h1><span>1</span> Description</h1>
178
<p>Helpful Ruby routines for parsing orgmode files. The most
189
significant thing this library does today is convert orgmode files
1910
to textile. Currently, you cannot do much to customize the
2011
conversion. The supplied textile conversion is optimized for
21-
extracting content from the orgfile as opposed to metadata.</p>
22-
<h1>2 History</h1>
23-
<h2>2.1 2014-02-08: Version 0.9.0</h2>
12+
extracting &#8220;content&#8221; from the orgfile as opposed to &#8220;metadata.&#8221;</p>
13+
<h1><span>2</span> History</h1>
14+
<h2><span>2.1</span> 2014-02-08: Version 0.9.0</h2>
2415
<ul>
25-
<li>Lets make sure <code>#+INCLUDE:</code> is not supported</li>
16+
<li>Let&#8217;s make sure <code>#+INCLUDE:</code> is not supported</li>
2617
</ul>
2718
<ul>
2819
<li>And confirm that syntax highlight is supported</li>
2920
</ul>
3021
<pre lang="ruby">
3122
module GitHub
3223
module Markup
33-
VERSION = 'test'
24+
VERSION = &#39;test&#39;
3425
Version = VERSION
3526
end
3627
end
3728
</pre>
38-
<h2>2.2 2009-12-30: Version 0.5.1</h2>
29+
<h2><span>2.2</span> 2009-12-30: Version 0.5.1</h2>
3930
<ul>
40-
<li>Minor enhancement: Recognize lines starting with “:” as examples.</li>
31+
<li>Minor enhancement: Recognize lines starting with &#8220;:&#8221; as examples.</li>
4132
<li>Minor enhancement: Recognize #+BEGIN_SRC as source blocks</li>
42-
<li>Minor enhancement: Add src and example classes to &lt;pre&gt; blocks.</li>
33+
<li>Minor enhancement: Add &#8220;src&#8221; and &#8220;example&#8221; classes to &lt;pre&gt; blocks.</li>
4334
</ul>
44-
<h2>2.3 2009-12-30: Version 0.5.0</h2>
35+
<h2><span>2.3</span> 2009-12-30: Version 0.5.0</h2>
4536
<ul>
4637
<li>Parse (but not necessarily <b>use</b>) in-buffer settings. The following
4738
in-buffer settings <b>are</b> used:
@@ -56,7 +47,7 @@ <h2>2.3 2009-12-30: Version 0.5.0</h2>
5647
the tree to export</li>
5748
</ul>
5849
</li>
59-
<li>Rewrite file:(blah).org links to http:(blah).html links. This
50+
<li>Rewrite &#8220;file:(blah).org&#8221; links to &#8220;http:(blah).html&#8221; links. This
6051
makes the inter-links to other org-mode files work.</li>
6152
<li>Uses &lt;th&gt; tags inside table rows that precede table separators.</li>
6253
<li>Bugfixes:
@@ -65,7 +56,7 @@ <h2>2.3 2009-12-30: Version 0.5.0</h2>
6556
</ul>
6657
</li>
6758
</ul>
68-
<h2>2.4 2009-12-29: Version 0.4.2</h2>
59+
<h2><span>2.4</span> 2009-12-29: Version 0.4.2</h2>
6960
<ul>
7061
<li>Got rid of the extraneous newline at the start of code blocks.</li>
7162
<li>Everything now shows up in code blocks, even org-mode metadata.</li>
@@ -76,59 +67,59 @@ <h2>2.4 2009-12-29: Version 0.4.2</h2>
7667
</ul>
7768
</li>
7869
</ul>
79-
<h2>2.5 2009-12-29: Version 0.4.1</h2>
70+
<h2><span>2.5</span> 2009-12-29: Version 0.4.1</h2>
8071
<ul>
8172
<li>HTML is now escaped by default</li>
8273
<li>org-mode comments will show up in a code block.</li>
8374
</ul>
84-
<h2>2.6 2009-12-29: Version 0.4</h2>
75+
<h2><span>2.6</span> 2009-12-29: Version 0.4</h2>
8576
<ul>
86-
<li>The first thing output in HTML gets the class title</li>
77+
<li>The first thing output in HTML gets the class &#8220;title&#8221;</li>
8778
<li>HTML output is now indented</li>
8879
<li>Proper support for multi-paragraph list items.
8980
<p>See? This paragraph is part of the last bullet.</p>
9081
</li>
9182
<li>Fixed bugs:
9283
<ul>
93-
<li>rake spec wouldnt work on Linux. Needed require rubygems’”.</li>
84+
<li>&#8220;rake spec&#8221; wouldn&#8217;t work on Linux. Needed &#8220;require &#8216;rubygems&#8217;&#8221;.</li>
9485
</ul>
9586
</li>
9687
</ul>
97-
<h2>2.7 2009-12-27: Version 0.3</h2>
88+
<h2><span>2.7</span> 2009-12-27: Version 0.3</h2>
9889
<ul>
99-
<li>Uses rubypants to get better typography (smart quotes, ellipses, etc).</li>
90+
<li>Uses rubypants to get better typography (smart quotes, ellipses, etc&#8230;).</li>
10091
<li>Fixed bugs:
10192
<ul>
10293
<li>Tables and lists did not get properly closed at the end of file</li>
103-
<li>You couldnt do inline formatting inside table cells</li>
94+
<li>You couldn&#8217;t do inline formatting inside table cells</li>
10495
<li>Characters in PRE blocks were not HTML escaped.</li>
10596
</ul>
10697
</li>
10798
</ul>
108-
<h2>2.8 2009-12-26: Version 0.2</h2>
99+
<h2><span>2.8</span> 2009-12-26: Version 0.2</h2>
109100
<ul>
110101
<li>Added <code>to_html</code> output on the parser.</li>
111102
<li>Added support for the full range of inline markup: <b>bold</b>,
112-
<i>italic</i>, <code>code</code>, <code>verbatim</code>, underline, <del>strikethrough</del>.</li>
103+
<i>italic</i>, <code>code</code>, <code>verbatim</code>, <span>underline</span>, <del>strikethrough</del>.</li>
113104
<li>Lots of refactoring to make the code more maintainable.</li>
114105
</ul>
115-
<h2>2.9 2009-12-23: Version 0.1</h2>
106+
<h2><span>2.9</span> 2009-12-23: Version 0.1</h2>
116107
<ul>
117108
<li>Added support for block code, like this:
118109
<pre>
119110
def flush!
120-
@logger.debug "FLUSH ==========&gt; #{@output_type}"
111+
@logger.debug &quot;FLUSH ==========&gt; #{@output_type}&quot;
121112
if (@output_type == :blank) then
122-
@output &lt;&lt; "\n"
113+
@output &lt;&lt; &quot;\n&quot;
123114
elsif (@buffer.length &gt; 0) then
124115
if @cancel_modifier then
125-
@output &lt;&lt; "p. " if @output_type == :paragraph
116+
@output &lt;&lt; &quot;p. &quot; if @output_type == :paragraph
126117
@cancel_modifier = false
127118
end
128119
@output &lt;&lt; @paragraph_modifier if (@paragraph_modifier and not sticky_modifier?)
129-
@output &lt;&lt; @buffer.textile_substitution &lt;&lt; "\n"
120+
@output &lt;&lt; @buffer.textile_substitution &lt;&lt; &quot;\n&quot;
130121
end
131-
@buffer = ""
122+
@buffer = &quot;&quot;
132123
end
133124
</pre>
134125
</li>

0 commit comments

Comments
 (0)