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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3af7e9cf8ed0fbc63c2705e680b36470373ee6c8d65f4140364c850413b9e3c
4
- data.tar.gz: 64d493460cd36838258eba6c51b8fb6d8273780aa9a4de4ccd70567016d44ec3
3
+ metadata.gz: 73045cfbb77a29fb57c75a078223e159987e9a94f322e3576e25d737947d2d6f
4
+ data.tar.gz: 0ad5872c59d15208af1be39b165634f29e7719de546dbaf3f14da47ac21f224f
5
5
  SHA512:
6
- metadata.gz: b02b26218266f9fdbf1211ee4cea875936936ddebed1a4b784b327a2911c1ae8ba6173f98b3d78b06b8e558afb87f707c136eac00a1e7696d6b0d610c4864bed
7
- data.tar.gz: 29820c650182ee9fb73cfbbe809a89ae7aa681359b8cd3d5116bc7cfe59e72cf96f971cdb96bc67d26e42546bc4b56d1694f31f735eeb465897db6d242491889
6
+ metadata.gz: 7687ca88baf80f98ba8bba10ba4ce5ab0ac909accfbb54dae340ceebf90f8ba0df36428b32b64c3850f0734b62b4e8573e5c005c85eb33c1d389272d6009805a
7
+ data.tar.gz: d33b942a879b556ac9e56913ea287ac64c9d702556a600c8bb8ba3a6c05f11641f846379cbbf504ce65568c98cf05ef1cda5a8d8932dcd99c37b29cea28da7b4
data/Gemfile CHANGED
@@ -11,5 +11,5 @@ gem "org-ruby", "= 0.9.9"
11
11
  gem "creole", "~>0.3.6"
12
12
  gem "wikicloth", "=0.8.3"
13
13
  gem "twitter-text", "~> 1.14"
14
- gem "asciidoctor", "= 1.5.6.1"
14
+ gem "asciidoctor", "~> 2.0.5"
15
15
  gem "rake"
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
  -----------
@@ -1,6 +1,6 @@
1
1
  module GitHub
2
2
  module Markup
3
- VERSION = '3.0.3'
3
+ VERSION = '3.0.4'
4
4
  Version = VERSION
5
5
  end
6
6
  end
@@ -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
@@ -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,
@@ -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 <<another-document#,another document>>.
12
+ Navigate from {docname}{outfilesuffix} to xref:another-document.asciidoc[another document].
11
13
 
12
14
  == Another Section
13
15
 
@@ -0,0 +1,4 @@
1
+ = Not Shown
2
+ :!showtitle:
3
+
4
+ This test verifies the author can disable the document title by adding `:!showtitle:` to the document header.
@@ -0,0 +1,3 @@
1
+ <div>
2
+ <p>This test verifies the author can disable the document title by adding <code>:!showtitle:</code> to the document header.</p>
3
+ </div>
@@ -0,0 +1,15 @@
1
+ = Document Title
2
+ :toc:
3
+ :toc-title: Contents
4
+
5
+ == Section A
6
+
7
+ === Subsection A-1
8
+
9
+ === Subsection A-2
10
+
11
+ == Section B
12
+
13
+ === Subsection B-1
14
+
15
+ === Subsection B-2
@@ -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.3
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: 2018-12-17 00:00:00.000000000 Z
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