github-markup 3.0.3 → 3.0.4
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 +4 -4
- data/Gemfile +1 -1
- data/HISTORY.md +5 -0
- data/README.md +0 -2
- data/lib/github-markup.rb +1 -1
- data/lib/github/markup.rb +2 -2
- data/lib/github/markups.rb +1 -0
- data/test/markup_test.rb +5 -2
- data/test/markups/README.asciidoc +3 -1
- data/test/markups/README.hidetitle.asciidoc +4 -0
- data/test/markups/README.hidetitle.asciidoc.html +3 -0
- data/test/markups/README.toc.asciidoc +15 -0
- data/test/markups/README.toc.asciidoc.html +46 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73045cfbb77a29fb57c75a078223e159987e9a94f322e3576e25d737947d2d6f
|
4
|
+
data.tar.gz: 0ad5872c59d15208af1be39b165634f29e7719de546dbaf3f14da47ac21f224f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7687ca88baf80f98ba8bba10ba4ce5ab0ac909accfbb54dae340ceebf90f8ba0df36428b32b64c3850f0734b62b4e8573e5c005c85eb33c1d389272d6009805a
|
7
|
+
data.tar.gz: d33b942a879b556ac9e56913ea287ac64c9d702556a600c8bb8ba3a6c05f11641f846379cbbf504ce65568c98cf05ef1cda5a8d8932dcd99c37b29cea28da7b4
|
data/Gemfile
CHANGED
data/HISTORY.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 3.0.4 - 2019-04-03
|
2
|
+
|
3
|
+
* Expose options in #render_s [#1249](https://github.com/github/markup/pull/1249)
|
4
|
+
* Upgrade to Asciidoctor 2.0.x [#1264](https://github.com/github/markup/pull/1264)
|
5
|
+
|
1
6
|
## 3.0.3 - 2018-12-17
|
2
7
|
|
3
8
|
* Temporarily remove support for POD6 [#1248](https://github.com/github/markup/pull/1248)
|
data/README.md
CHANGED
@@ -29,8 +29,6 @@ you wish to run the library. You can also run `script/bootstrap` to fetch them a
|
|
29
29
|
* [.asciidoc, .adoc, .asc](http://asciidoc.org/) -- `gem install asciidoctor` (http://asciidoctor.org)
|
30
30
|
* [.pod](http://search.cpan.org/dist/perl/pod/perlpod.pod) -- `Pod::Simple::XHTML`
|
31
31
|
comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
|
32
|
-
* [.pod6](https://docs.perl6.org/language/pod) -- No additional
|
33
|
-
dependency beyond perl6 `Pod::To::HTML` (in stdlib)
|
34
32
|
|
35
33
|
Installation
|
36
34
|
-----------
|
data/lib/github-markup.rb
CHANGED
data/lib/github/markup.rb
CHANGED
@@ -47,11 +47,11 @@ module GitHub
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
def render_s(symbol, content)
|
50
|
+
def render_s(symbol, content, options: {})
|
51
51
|
raise ArgumentError, 'Can not render a nil.' if content.nil?
|
52
52
|
|
53
53
|
if markups.key?(symbol)
|
54
|
-
markups[symbol].render(nil, content)
|
54
|
+
markups[symbol].render(nil, content, options: options)
|
55
55
|
else
|
56
56
|
content
|
57
57
|
end
|
data/lib/github/markups.rb
CHANGED
@@ -32,6 +32,7 @@ markup(::GitHub::Markups::MARKUP_ASCIIDOC, :asciidoctor, /adoc|asc(iidoc)?/, ["A
|
|
32
32
|
'showtitle' => '@',
|
33
33
|
'idprefix' => '',
|
34
34
|
'idseparator' => '-',
|
35
|
+
'sectanchors' => nil,
|
35
36
|
'docname' => File.basename(filename, (extname = File.extname(filename))),
|
36
37
|
'docfilesuffix' => extname,
|
37
38
|
'outfilesuffix' => extname,
|
data/test/markup_test.rb
CHANGED
@@ -72,7 +72,7 @@ class MarkupTest < Minitest::Test
|
|
72
72
|
message
|
73
73
|
end
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
def test_knows_what_it_can_and_cannot_render
|
77
77
|
assert_equal false, GitHub::Markup.can_render?('README.html', '<h1>Title</h1>')
|
78
78
|
assert_equal true, GitHub::Markup.can_render?('README.markdown', '=== Title')
|
@@ -92,7 +92,7 @@ message
|
|
92
92
|
assert_equal "pod", GitHub::Markup.renderer('README.pod', '=head1').name
|
93
93
|
assert_equal "pod6", GitHub::Markup.renderer('README.pod6', '=begin pod').name
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
def test_rendering_by_symbol
|
97
97
|
assert_equal '<p><code>test</code></p>', GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, '`test`').strip
|
98
98
|
end
|
@@ -117,5 +117,8 @@ message
|
|
117
117
|
def test_commonmarker_options
|
118
118
|
assert_equal "<p>hello <!-- raw HTML omitted --> world</p>\n", GitHub::Markup.render("test.md", "hello <bad> world")
|
119
119
|
assert_equal "<p>hello <bad> world</p>\n", GitHub::Markup.render("test.md", "hello <bad> world", options: {commonmarker_opts: [:UNSAFE]})
|
120
|
+
|
121
|
+
assert_equal "<p>hello <!-- raw HTML omitted --> world</p>\n", GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "hello <bad> world")
|
122
|
+
assert_equal "<p>hello <bad> world</p>\n", GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "hello <bad> world", options: {commonmarker_opts: [:UNSAFE]})
|
120
123
|
end
|
121
124
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
= Document Title
|
2
|
+
// sectanchors will be ignored
|
3
|
+
:sectanchors:
|
2
4
|
|
3
5
|
== First Section
|
4
6
|
|
@@ -7,7 +9,7 @@
|
|
7
9
|
|
8
10
|
Refer to <<another-section>> or <<another-section-1>>.
|
9
11
|
|
10
|
-
Navigate from {docname}{outfilesuffix} to
|
12
|
+
Navigate from {docname}{outfilesuffix} to xref:another-document.asciidoc[another document].
|
11
13
|
|
12
14
|
== Another Section
|
13
15
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<h1>Document Title</h1>
|
2
|
+
<div>
|
3
|
+
<div>Contents</div>
|
4
|
+
<ul>
|
5
|
+
<li>
|
6
|
+
<a href="#section-a">Section A</a>
|
7
|
+
<ul>
|
8
|
+
<li><a href="#subsection-a-1">Subsection A-1</a></li>
|
9
|
+
<li><a href="#subsection-a-2">Subsection A-2</a></li>
|
10
|
+
</ul>
|
11
|
+
</li>
|
12
|
+
<li>
|
13
|
+
<a href="#section-b">Section B</a>
|
14
|
+
<ul>
|
15
|
+
<li><a href="#subsection-b-1">Subsection B-1</a></li>
|
16
|
+
<li><a href="#subsection-b-2">Subsection B-2</a></li>
|
17
|
+
</ul>
|
18
|
+
</li>
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
<div>
|
22
|
+
<h2>Section A</h2>
|
23
|
+
<div>
|
24
|
+
<div>
|
25
|
+
<h3>Subsection A-1</h3>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
<div>
|
29
|
+
<h3>Subsection A-2</h3>
|
30
|
+
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
<div>
|
35
|
+
<h2>Section B</h2>
|
36
|
+
<div>
|
37
|
+
<div>
|
38
|
+
<h3>Subsection B-1</h3>
|
39
|
+
|
40
|
+
</div>
|
41
|
+
<div>
|
42
|
+
<h3>Subsection B-2</h3>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-markup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -178,6 +178,8 @@ files:
|
|
178
178
|
- test/markups/README.creole.html
|
179
179
|
- test/markups/README.directives.rst
|
180
180
|
- test/markups/README.directives.rst.html
|
181
|
+
- test/markups/README.hidetitle.asciidoc
|
182
|
+
- test/markups/README.hidetitle.asciidoc.html
|
181
183
|
- test/markups/README.litcoffee
|
182
184
|
- test/markups/README.litcoffee.html
|
183
185
|
- test/markups/README.markdown
|
@@ -198,6 +200,8 @@ files:
|
|
198
200
|
- test/markups/README.rst.txt.html
|
199
201
|
- test/markups/README.textile
|
200
202
|
- test/markups/README.textile.html
|
203
|
+
- test/markups/README.toc.asciidoc
|
204
|
+
- test/markups/README.toc.asciidoc.html
|
201
205
|
- test/markups/README.toc.rst
|
202
206
|
- test/markups/README.toc.rst.html
|
203
207
|
- test/markups/README.txt
|
@@ -235,6 +239,8 @@ test_files:
|
|
235
239
|
- test/markups/README.creole.html
|
236
240
|
- test/markups/README.directives.rst
|
237
241
|
- test/markups/README.directives.rst.html
|
242
|
+
- test/markups/README.hidetitle.asciidoc
|
243
|
+
- test/markups/README.hidetitle.asciidoc.html
|
238
244
|
- test/markups/README.litcoffee
|
239
245
|
- test/markups/README.litcoffee.html
|
240
246
|
- test/markups/README.markdown
|
@@ -255,6 +261,8 @@ test_files:
|
|
255
261
|
- test/markups/README.rst.txt.html
|
256
262
|
- test/markups/README.textile
|
257
263
|
- test/markups/README.textile.html
|
264
|
+
- test/markups/README.toc.asciidoc
|
265
|
+
- test/markups/README.toc.asciidoc.html
|
258
266
|
- test/markups/README.toc.rst
|
259
267
|
- test/markups/README.toc.rst.html
|
260
268
|
- test/markups/README.txt
|