github-markup 4.0.0 → 4.0.2
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 +5 -5
- data/.github/workflows/ci.yml +58 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +3 -1
- data/HISTORY.md +6 -0
- data/lib/github/commands/rest2html +30 -1
- data/lib/github/markup/markdown.rb +2 -2
- data/lib/github-markup.rb +1 -1
- data/test/markups/README.rst +6 -0
- data/test/markups/README.rst.html +6 -5
- metadata +4 -5
- data/.travis.yml +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cd63799d40b4736d12d90eb198959465570f9516bbe8d63badf267525f3f6e9f
|
4
|
+
data.tar.gz: 4327fcc8c8ff440c838bb04b862267cc1780a866c177c56a26e3b840ec9d729f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca67d30be3dacfa8b4d2e7ec0824e7ecc45692a610e4c12f56f85f4cce609ad8c1a79a1aef35a40b0b45834b14d04ca7876d43c4a5a4a6959f2ba003ffe5d475
|
7
|
+
data.tar.gz: 95e8e50c8effb1af7884bfa996f006899818f9a07288a02371518258e002fd91f240da891be2ff2e3830b231380d4ff17ecac43113d6bafc6633f9ef9b170eb3
|
@@ -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/CONTRIBUTING.md
CHANGED
@@ -11,7 +11,7 @@ This library's only job is to decide which markup format to use and call out to
|
|
11
11
|
If you are having an issue with:
|
12
12
|
|
13
13
|
* **Syntax highlighting** - see [github/linguist](https://github.com/github/linguist/blob/master/CONTRIBUTING.md#fixing-syntax-highlighting)
|
14
|
-
* **Markdown on GitHub** - contact support
|
14
|
+
* **Markdown on GitHub** - contact [GitHub Support](https://support.github.com/)
|
15
15
|
* **Styling issues on GitHub** - see [primer-markdown](https://github.com/primer/primer-css/tree/master/modules/primer-markdown) module in the [primer/primer-css](https://github.com/primer/primer-css) repository
|
16
16
|
|
17
17
|
Anything else - [search open issues](https://github.com/github/markup/issues) or create an issue and and we'll help point you in the right direction.
|
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,9 @@
|
|
1
|
+
## 4.0.2 - 2023-10-10
|
2
|
+
* Add support for .mdx files in markdown
|
3
|
+
|
4
|
+
## 4.0.1 - 2022-03-07
|
5
|
+
* 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)
|
6
|
+
|
1
7
|
## 4.0.0 - 2021-03-31
|
2
8
|
|
3
9
|
* Drop support for Python 2 in RST rendering [#1456](https://github.com/github/markup/pull/1456)
|
@@ -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-markup.rb
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,7 +9,7 @@
|
|
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>
|
@@ -64,6 +64,9 @@ A block of code
|
|
64
64
|
python.code('hooray')
|
65
65
|
</pre>
|
66
66
|
<pre lang="python">
|
67
|
+
python.code('hello world')
|
68
|
+
</pre>
|
69
|
+
<pre lang="python">
|
67
70
|
>>> some_function()
|
68
71
|
'result'
|
69
72
|
</pre>
|
@@ -103,7 +106,7 @@ python.code('hooray')
|
|
103
106
|
</a>
|
104
107
|
<img alt="Coverity Scan Build Status" src="https://scan.coverity.com/projects/621/badge.svg">
|
105
108
|
<a name="field-list"></a>
|
106
|
-
<h2><a href="#
|
109
|
+
<h2><a href="#toc-entry-2">Field list</a></h2>
|
107
110
|
<table frame="void" rules="none">
|
108
111
|
|
109
112
|
|
@@ -128,9 +131,7 @@ but no problem!</td>
|
|
128
131
|
</tr>
|
129
132
|
</tbody>
|
130
133
|
</table>
|
131
|
-
|
132
134
|
<p><a href="mailto:someone@somewhere.org">someone@somewhere.org</a></p>
|
133
|
-
|
134
135
|
<p>Press <kbd>Ctrl+C</kbd> to quit</p>
|
135
136
|
|
136
|
-
<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.0.
|
4
|
+
version: 4.0.2
|
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: 2023-10-11 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,8 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
|
-
|
224
|
-
rubygems_version: 2.6.11
|
223
|
+
rubygems_version: 3.0.3
|
225
224
|
signing_key:
|
226
225
|
specification_version: 4
|
227
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"
|