github-markup 3.0.5 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +58 -0
- data/Gemfile +3 -1
- data/HISTORY.md +9 -2
- data/lib/github/commands/rest2html +30 -1
- data/lib/github/markups.rb +1 -1
- data/lib/github-markup.rb +1 -1
- data/script/bootstrap +1 -1
- data/test/markups/README.rst +6 -0
- data/test/markups/README.rst.html +47 -5
- metadata +4 -4
- data/.travis.yml +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 460b133e720fe08106c84643e1f7b1ca9e2878fbbd3c6cf5865a287f5e5bf92f
|
4
|
+
data.tar.gz: 16a8c4145ec42146e945c7cd4cfb3e7819701f099e5de43528b770087ce114b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c6307defe17fe273441c24a615b15840fdfd7a36e2e1585ef7ce84c6bcbf39c6f512a1a354541e713bb957f1f42771423fe06f354f37fe6cd1f4881357980dc
|
7
|
+
data.tar.gz: 57fd400b0a38e898eb27da5db1d0335eea594530cce97b5748bb70d6d8594d79e7ec90a72dbfe9e16e85957b93d3da42d7e2805dd57eec28f10dd9afb6153428
|
@@ -0,0 +1,58 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push, pull_request]
|
3
|
+
|
4
|
+
env:
|
5
|
+
JRUBY_OPTS: -Xcext.enabled=true
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: "Test / Ruby ${{ matrix.ruby }}"
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
strategy:
|
12
|
+
matrix:
|
13
|
+
ruby:
|
14
|
+
- "2.4"
|
15
|
+
- "2.5"
|
16
|
+
- "2.6"
|
17
|
+
- "2.7"
|
18
|
+
fail-fast: false
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- name: Checkout
|
22
|
+
uses: actions/checkout@v2
|
23
|
+
with:
|
24
|
+
fetch-depth: 10
|
25
|
+
|
26
|
+
- uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby }}
|
29
|
+
bundler-cache: true
|
30
|
+
|
31
|
+
- uses: actions/setup-python@v2
|
32
|
+
with:
|
33
|
+
# This should match lib/github/markups.rb GitHub::Markups::MARKUP_RST
|
34
|
+
python-version: '3.x'
|
35
|
+
|
36
|
+
- uses: actions/cache@v2
|
37
|
+
with:
|
38
|
+
path: ~/.cache/pip
|
39
|
+
key: ${{ runner.os }}-pip
|
40
|
+
|
41
|
+
- name: Install Perl dependencies
|
42
|
+
run: |
|
43
|
+
curl -1sLf \
|
44
|
+
'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/setup.deb.sh' \
|
45
|
+
| sudo -E bash
|
46
|
+
sudo apt-get update -qq
|
47
|
+
sudo apt-get install perl rakudo-pkg
|
48
|
+
|
49
|
+
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
|
50
|
+
sudo cpanm --installdeps --notest Pod::Simple
|
51
|
+
|
52
|
+
- name: Install Python dependencies
|
53
|
+
run: python -m pip install docutils
|
54
|
+
|
55
|
+
- name: Run rake
|
56
|
+
run: |
|
57
|
+
export PATH=$PATH:/.perl6/bin:/opt/rakudo-pkg/bin
|
58
|
+
bundle exec rake
|
data/Gemfile
CHANGED
@@ -5,7 +5,9 @@ gem "posix-spawn", :platforms => :ruby
|
|
5
5
|
gem "redcarpet", :platforms => :ruby
|
6
6
|
gem "kramdown", :platforms => :jruby
|
7
7
|
gem "RedCloth"
|
8
|
-
|
8
|
+
# using a tag version here because 0.18.3 was not published by the author to encourage users to upgrade.
|
9
|
+
# however we want to bump up to this version since this has a security patch
|
10
|
+
gem "commonmarker", git: "https://github.com/gjtorikian/commonmarker.git", tag: "v0.18.3"
|
9
11
|
gem "rdoc", "~>3.6"
|
10
12
|
gem "org-ruby", "= 0.9.9"
|
11
13
|
gem "creole", "~>0.3.6"
|
data/HISTORY.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 4.0.1 - 2022-03-07
|
2
|
+
* Update to commonmarker 0.18.3; There isn't a version on RubyGems for this, so this is pointing to a [tag version on GitHub](https://github.com/gjtorikian/commonmarker/blob/v0.18.3/commonmarker.gemspec)
|
3
|
+
|
4
|
+
## 4.0.0 - 2021-03-31
|
5
|
+
|
6
|
+
* Drop support for Python 2 in RST rendering [#1456](https://github.com/github/markup/pull/1456)
|
7
|
+
|
1
8
|
## 3.0.5 - 2020-11-12
|
2
9
|
|
3
10
|
* Add commonmarker_exts to commonmarker options [#1268](https://github.com/github/markup/pull/1268)
|
@@ -72,8 +79,8 @@
|
|
72
79
|
|
73
80
|
### Added
|
74
81
|
|
75
|
-
* Re-introduce [#537](https://github.com/github/markup/pull/537) to detect language of markup document
|
76
|
-
However `github-linguist` is optional and this gem will fallback to extensions for detection.
|
82
|
+
* Re-introduce [#537](https://github.com/github/markup/pull/537) to detect language of markup document
|
83
|
+
However `github-linguist` is optional and this gem will fallback to extensions for detection.
|
77
84
|
|
78
85
|
[Full changelog](https://github.com/github/markup/compare/v1.4.9...v1.5.0)
|
79
86
|
|
@@ -47,7 +47,7 @@ except:
|
|
47
47
|
import codecs
|
48
48
|
import io
|
49
49
|
|
50
|
-
from docutils import nodes
|
50
|
+
from docutils import nodes, utils
|
51
51
|
from docutils.parsers.rst import directives, roles
|
52
52
|
from docutils.parsers.rst.directives.body import CodeBlock, Directive
|
53
53
|
from docutils.core import publish_parts
|
@@ -76,6 +76,35 @@ from docutils import nodes
|
|
76
76
|
original_behavior = False # Documents original docutils behavior
|
77
77
|
github_display = True
|
78
78
|
|
79
|
+
def extract_extension_options(field_list, option_spec):
|
80
|
+
"""
|
81
|
+
Overrides `utils.extract_extension_options` and inlines
|
82
|
+
`utils.assemble_option_dict` to make it ignore unknown options passed to
|
83
|
+
directives (i.e. ``:caption:`` for ``.. code-block:``).
|
84
|
+
"""
|
85
|
+
|
86
|
+
dropped = set()
|
87
|
+
options = {}
|
88
|
+
for name, value in utils.extract_options(field_list):
|
89
|
+
convertor = option_spec.get(name)
|
90
|
+
if name in options or name in dropped:
|
91
|
+
raise utils.DuplicateOptionError('duplicate option "%s"' % name)
|
92
|
+
|
93
|
+
# silently drop unknown options as long as they are not duplicates
|
94
|
+
if convertor is None:
|
95
|
+
dropped.add(name)
|
96
|
+
continue
|
97
|
+
|
98
|
+
# continue as before
|
99
|
+
try:
|
100
|
+
options[name] = convertor(value)
|
101
|
+
except (ValueError, TypeError) as detail:
|
102
|
+
raise detail.__class__('(option: "%s"; value: %r)\n%s'
|
103
|
+
% (name, value, ' '.join(detail.args)))
|
104
|
+
return options
|
105
|
+
|
106
|
+
utils.extract_extension_options = extract_extension_options
|
107
|
+
|
79
108
|
def unknown_directive(self, type_name):
|
80
109
|
lineno = self.state_machine.abs_line_number()
|
81
110
|
indented, indent, offset, blank_finish = \
|
data/lib/github/markups.rb
CHANGED
@@ -49,7 +49,7 @@ end
|
|
49
49
|
|
50
50
|
command(
|
51
51
|
::GitHub::Markups::MARKUP_RST,
|
52
|
-
"
|
52
|
+
"python3 #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html",
|
53
53
|
/re?st(\.txt)?/,
|
54
54
|
["reStructuredText"],
|
55
55
|
"restructuredtext"
|
data/lib/github-markup.rb
CHANGED
data/script/bootstrap
CHANGED
data/test/markups/README.rst
CHANGED
@@ -39,6 +39,12 @@ The UTF-8 quote character in this table used to cause python to go boom. Now doc
|
|
39
39
|
|
40
40
|
python.code('hooray')
|
41
41
|
|
42
|
+
.. code:: python
|
43
|
+
:caption: An ignored Sphinx option
|
44
|
+
:made-up-option: An ignored made up option
|
45
|
+
|
46
|
+
python.code('hello world')
|
47
|
+
|
42
48
|
.. doctest:: ignored
|
43
49
|
|
44
50
|
>>> some_function()
|
@@ -9,13 +9,54 @@
|
|
9
9
|
</ul>
|
10
10
|
</div>
|
11
11
|
<a name="header-2"></a>
|
12
|
-
<h2><a href="#
|
12
|
+
<h2><a href="#toc-entry-1">Header 2</a></h2>
|
13
13
|
<ol>
|
14
14
|
<li>Blah blah <code>code</code> blah</li>
|
15
15
|
<li>More <code>code</code>, hooray</li>
|
16
16
|
<li>Somé UTF-8°</li>
|
17
17
|
</ol>
|
18
18
|
<p>The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.</p>
|
19
|
+
<table>
|
20
|
+
Things that are Awesome (on a scale of 1-11)
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
<tbody valign="top">
|
26
|
+
<tr>
|
27
|
+
<td>Thing</td>
|
28
|
+
<td>Awesomeness</td>
|
29
|
+
</tr>
|
30
|
+
<tr>
|
31
|
+
<td>Icecream</td>
|
32
|
+
<td>7</td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<td>Honey Badgers</td>
|
36
|
+
<td>10.5</td>
|
37
|
+
</tr>
|
38
|
+
<tr>
|
39
|
+
<td>Nickelback</td>
|
40
|
+
<td>-2</td>
|
41
|
+
</tr>
|
42
|
+
<tr>
|
43
|
+
<td>Iron Man</td>
|
44
|
+
<td>10</td>
|
45
|
+
</tr>
|
46
|
+
<tr>
|
47
|
+
<td>Iron Man 2</td>
|
48
|
+
<td>3</td>
|
49
|
+
</tr>
|
50
|
+
<tr>
|
51
|
+
<td>Tabular Data</td>
|
52
|
+
<td>5</td>
|
53
|
+
</tr>
|
54
|
+
<tr>
|
55
|
+
<td>Made up ratings</td>
|
56
|
+
<td>11</td>
|
57
|
+
</tr>
|
58
|
+
</tbody>
|
59
|
+
</table>
|
19
60
|
<pre>
|
20
61
|
A block of code
|
21
62
|
</pre>
|
@@ -23,6 +64,9 @@ A block of code
|
|
23
64
|
python.code('hooray')
|
24
65
|
</pre>
|
25
66
|
<pre lang="python">
|
67
|
+
python.code('hello world')
|
68
|
+
</pre>
|
69
|
+
<pre lang="python">
|
26
70
|
>>> some_function()
|
27
71
|
'result'
|
28
72
|
</pre>
|
@@ -62,7 +106,7 @@ python.code('hooray')
|
|
62
106
|
</a>
|
63
107
|
<img alt="Coverity Scan Build Status" src="https://scan.coverity.com/projects/621/badge.svg">
|
64
108
|
<a name="field-list"></a>
|
65
|
-
<h2><a href="#
|
109
|
+
<h2><a href="#toc-entry-2">Field list</a></h2>
|
66
110
|
<table frame="void" rules="none">
|
67
111
|
|
68
112
|
|
@@ -87,9 +131,7 @@ but no problem!</td>
|
|
87
131
|
</tr>
|
88
132
|
</tbody>
|
89
133
|
</table>
|
90
|
-
|
91
134
|
<p><a href="mailto:someone@somewhere.org">someone@somewhere.org</a></p>
|
92
|
-
|
93
135
|
<p>Press <kbd>Ctrl+C</kbd> to quit</p>
|
94
136
|
|
95
|
-
<p><strong>RAW HTML!</strong></p> p {color:blue;}
|
137
|
+
<p><strong>RAW HTML!</strong></p> p {color:blue;}
|
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:
|
4
|
+
version: 4.0.1
|
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: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -138,9 +138,9 @@ extensions: []
|
|
138
138
|
extra_rdoc_files: []
|
139
139
|
files:
|
140
140
|
- ".dockerignore"
|
141
|
+
- ".github/workflows/ci.yml"
|
141
142
|
- ".gitignore"
|
142
143
|
- ".kick"
|
143
|
-
- ".travis.yml"
|
144
144
|
- CODE_OF_CONDUCT.md
|
145
145
|
- CONTRIBUTING.md
|
146
146
|
- Dockerfile
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
|
-
rubygems_version: 3.
|
223
|
+
rubygems_version: 3.2.9
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: The code GitHub uses to render README.markup
|
data/.travis.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
dist: trusty
|
2
|
-
sudo: required
|
3
|
-
language: ruby
|
4
|
-
rvm:
|
5
|
-
- 2.1.10
|
6
|
-
- 2.2.7
|
7
|
-
- 2.3.4
|
8
|
-
- 2.4.1
|
9
|
-
notifications:
|
10
|
-
email: false
|
11
|
-
git:
|
12
|
-
depth: 10
|
13
|
-
before_install:
|
14
|
-
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 379CE192D401AB61
|
15
|
-
- echo "deb https://dl.bintray.com/nxadm/rakudo-pkg-debs `lsb_release -cs` main" | sudo tee -a /etc/apt/sources.list.d/rakudo-pkg.list
|
16
|
-
- sudo apt-get update -qq
|
17
|
-
- sudo apt-get install perl rakudo-pkg
|
18
|
-
- export PATH=$PATH:/.perl6/bin:/opt/rakudo-pkg/bin
|
19
|
-
- curl -L http://cpanmin.us | perl - --sudo App::cpanminus
|
20
|
-
- sudo cpanm --installdeps --notest Pod::Simple
|
21
|
-
- sudo pip install docutils
|
22
|
-
cache:
|
23
|
-
- bundler
|
24
|
-
- pip
|
25
|
-
env:
|
26
|
-
global:
|
27
|
-
- "JRUBY_OPTS=-Xcext.enabled=true"
|