github-markup 4.0.1 → 5.0.0
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/.github/workflows/ci.yml +4 -4
- data/.gitignore +2 -1
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +2 -2
- data/HISTORY.md +10 -0
- data/github-markup.gemspec +4 -3
- data/lib/github/markup/command_implementation.rb +8 -28
- data/lib/github/markup/markdown.rb +2 -2
- data/lib/github-markup.rb +1 -1
- data/test/markup_test.rb +6 -1
- data/test/markups/README.asciidoc.html +1 -1
- data/test/markups/README.hidetitle.asciidoc.html +1 -1
- data/test/markups/README.litcoffee.html +1 -1
- data/test/markups/README.long.rst +1319 -0
- data/test/markups/README.long.rst.html +1303 -0
- data/test/markups/README.mediawiki.html +9 -5
- data/test/markups/README.pod.html +8 -4
- data/test/markups/README.rst.html +4 -4
- data/test/markups/README.toc.asciidoc.html +1 -1
- data/test/markups/README.toc.rst.html +2 -2
- metadata +15 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c0a1b208f2db4d8dbe2da7b892e9ab357901f60a4474967ffce14103a57cbea
|
4
|
+
data.tar.gz: a4d1eb586fdcf139731eb53550af3ce1a6bd4216dc44a2b7bd3bb6f69f237ecf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70544a9808c1858e816e37e283ecc2688b9c775b642f609f3cf92eefb4b6c6cdcf91386c1f058c5e13c90afd537aa99caf188f4ed8a78cd657f6ec50159f8d6f
|
7
|
+
data.tar.gz: a101a59c827e06dd5f687a22c5f7fdfe0316d4ff2cfee7d36d13df0b2bfd65669f1340a072013a02e9e120705d31d0bfaf5efe42b6024e127005b6541bb70dce
|
data/.github/workflows/ci.yml
CHANGED
data/.gitignore
CHANGED
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
@@ -1,17 +1,17 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
gemspec
|
3
3
|
|
4
|
-
gem "posix-spawn", :platforms => :ruby
|
5
4
|
gem "redcarpet", :platforms => :ruby
|
6
5
|
gem "kramdown", :platforms => :jruby
|
7
6
|
gem "RedCloth"
|
8
7
|
# using a tag version here because 0.18.3 was not published by the author to encourage users to upgrade.
|
9
8
|
# however we want to bump up to this version since this has a security patch
|
10
9
|
gem "commonmarker", git: "https://github.com/gjtorikian/commonmarker.git", tag: "v0.18.3"
|
11
|
-
gem "rdoc", "~>
|
10
|
+
gem "rdoc", "~> 6.7.0"
|
12
11
|
gem "org-ruby", "= 0.9.9"
|
13
12
|
gem "creole", "~>0.3.6"
|
14
13
|
gem "wikicloth", "=0.8.3"
|
15
14
|
gem "twitter-text", "~> 1.14"
|
16
15
|
gem "asciidoctor", "~> 2.0.5"
|
17
16
|
gem "rake"
|
17
|
+
gem "rexml"
|
data/HISTORY.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 5.0.0 - 2024-06-17
|
2
|
+
* Drop support for Ruby versions < 3
|
3
|
+
* Bump nokogiri from 1.8.1 to 1.16.5
|
4
|
+
* Bump nokogiri-diff from 0.2.0 to 0.3.0
|
5
|
+
* Bump rdoc from 3.6 to 6.7.0
|
6
|
+
* Update CommandImplementation to better support large files (affecting RST and POD6 rendering)
|
7
|
+
|
8
|
+
## 4.0.2 - 2023-10-10
|
9
|
+
* Add support for .mdx files in markdown
|
10
|
+
|
1
11
|
## 4.0.1 - 2022-03-07
|
2
12
|
* 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
13
|
|
data/github-markup.gemspec
CHANGED
@@ -13,8 +13,9 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.homepage = "https://github.com/github/markup"
|
14
14
|
s.license = "MIT"
|
15
15
|
|
16
|
+
s.required_ruby_version = '>= 3.0.0'
|
17
|
+
|
16
18
|
s.files = `git ls-files`.split($\)
|
17
|
-
s.files += Dir['vendor/**/*']
|
18
19
|
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
19
20
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
20
21
|
s.require_paths = %w[lib]
|
@@ -24,7 +25,7 @@ Gem::Specification.new do |s|
|
|
24
25
|
s.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
|
25
26
|
s.add_development_dependency 'html-pipeline', '~> 1.0'
|
26
27
|
s.add_development_dependency 'sanitize', '>= 4.6.3'
|
27
|
-
s.add_development_dependency 'nokogiri', '~> 1.
|
28
|
-
s.add_development_dependency 'nokogiri-diff', '~> 0.
|
28
|
+
s.add_development_dependency 'nokogiri', '~> 1.16.5'
|
29
|
+
s.add_development_dependency 'nokogiri-diff', '~> 0.3.0'
|
29
30
|
s.add_development_dependency "github-linguist", ">= 7.1.3"
|
30
31
|
end
|
@@ -1,9 +1,4 @@
|
|
1
|
-
|
2
|
-
require "posix-spawn"
|
3
|
-
rescue LoadError
|
4
|
-
require "open3"
|
5
|
-
end
|
6
|
-
|
1
|
+
require "open3"
|
7
2
|
require "github/markup/implementation"
|
8
3
|
|
9
4
|
|
@@ -39,28 +34,13 @@ module GitHub
|
|
39
34
|
end
|
40
35
|
end
|
41
36
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
end
|
51
|
-
else
|
52
|
-
def execute(command, target)
|
53
|
-
output = Open3.popen3(*command) do |stdin, stdout, stderr, wait_thr|
|
54
|
-
stdin.puts target
|
55
|
-
stdin.close
|
56
|
-
if wait_thr.value.success?
|
57
|
-
stdout.readlines
|
58
|
-
else
|
59
|
-
raise CommandError.new(stderr.readlines.join('').strip)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
sanitize(output.join(''), target.encoding)
|
63
|
-
end
|
37
|
+
def execute(command, target)
|
38
|
+
# capture3 blocks until both buffers are written to and the process terminates, but
|
39
|
+
# it won't allow either buffer to fill up
|
40
|
+
stdout, stderr, status = Open3.capture3(*command, stdin_data: target)
|
41
|
+
|
42
|
+
raise CommandError.new(stderr) unless status.success?
|
43
|
+
sanitize(stdout, target.encoding)
|
64
44
|
end
|
65
45
|
|
66
46
|
def sanitize(input, encoding)
|
data/lib/github-markup.rb
CHANGED
data/test/markup_test.rb
CHANGED
@@ -66,6 +66,11 @@ class MarkupTest < Minitest::Test
|
|
66
66
|
f.close_write
|
67
67
|
f.read
|
68
68
|
end
|
69
|
+
|
70
|
+
if ENV['UPDATE']
|
71
|
+
File.open(expected_file, 'w') { |f| f.write actual }
|
72
|
+
end
|
73
|
+
|
69
74
|
assert_html_equal expected, actual, <<message
|
70
75
|
#{File.basename expected_file}'s contents are not html equal to output:
|
71
76
|
#{diff}
|
@@ -106,7 +111,7 @@ message
|
|
106
111
|
begin
|
107
112
|
GitHub::Markup.render('README.java', "stop swallowing errors", symlink: false)
|
108
113
|
rescue GitHub::Markup::CommandError => e
|
109
|
-
assert_equal "failure message", e.message
|
114
|
+
assert_equal "failure message", e.message.strip
|
110
115
|
else
|
111
116
|
fail "an exception was expected but was not raised"
|
112
117
|
end
|