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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 460b133e720fe08106c84643e1f7b1ca9e2878fbbd3c6cf5865a287f5e5bf92f
4
- data.tar.gz: 16a8c4145ec42146e945c7cd4cfb3e7819701f099e5de43528b770087ce114b9
3
+ metadata.gz: 0c0a1b208f2db4d8dbe2da7b892e9ab357901f60a4474967ffce14103a57cbea
4
+ data.tar.gz: a4d1eb586fdcf139731eb53550af3ce1a6bd4216dc44a2b7bd3bb6f69f237ecf
5
5
  SHA512:
6
- metadata.gz: 7c6307defe17fe273441c24a615b15840fdfd7a36e2e1585ef7ce84c6bcbf39c6f512a1a354541e713bb957f1f42771423fe06f354f37fe6cd1f4881357980dc
7
- data.tar.gz: 57fd400b0a38e898eb27da5db1d0335eea594530cce97b5748bb70d6d8594d79e7ec90a72dbfe9e16e85957b93d3da42d7e2805dd57eec28f10dd9afb6153428
6
+ metadata.gz: 70544a9808c1858e816e37e283ecc2688b9c775b642f609f3cf92eefb4b6c6cdcf91386c1f058c5e13c90afd537aa99caf188f4ed8a78cd657f6ec50159f8d6f
7
+ data.tar.gz: a101a59c827e06dd5f687a22c5f7fdfe0316d4ff2cfee7d36d13df0b2bfd65669f1340a072013a02e9e120705d31d0bfaf5efe42b6024e127005b6541bb70dce
@@ -11,10 +11,10 @@ jobs:
11
11
  strategy:
12
12
  matrix:
13
13
  ruby:
14
- - "2.4"
15
- - "2.5"
16
- - "2.6"
17
- - "2.7"
14
+ - "3.0"
15
+ - "3.1"
16
+ - "3.2"
17
+ - "3.3"
18
18
  fail-fast: false
19
19
 
20
20
  steps:
data/.gitignore CHANGED
@@ -4,4 +4,5 @@ pkg/
4
4
  Gemfile.lock
5
5
  .project
6
6
  .buildpath
7
- *~
7
+ *~
8
+ vendor/
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@github.com
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", "~>3.6"
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
 
@@ -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.8.1'
28
- s.add_development_dependency 'nokogiri-diff', '~> 0.2.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
- begin
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
- if defined?(POSIX::Spawn)
43
- def execute(command, target)
44
- spawn = POSIX::Spawn::Child.new(*command, :input => target)
45
- if spawn.status.success?
46
- sanitize(spawn.out, target.encoding)
47
- else
48
- raise CommandError.new(spawn.err.strip)
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)
@@ -31,8 +31,8 @@ module GitHub
31
31
 
32
32
  def initialize
33
33
  super(
34
- /md|mkdn?|mdwn|mdown|markdown|litcoffee/i,
35
- ["Markdown", "Literate CoffeeScript"])
34
+ /md|mkdn?|mdwn|mdown|markdown|mdx|litcoffee/i,
35
+ ["Markdown", "MDX", "Literate CoffeeScript"])
36
36
  end
37
37
 
38
38
  def load
data/lib/github-markup.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module GitHub
2
2
  module Markup
3
- VERSION = '4.0.1'
3
+ VERSION = '5.0.0'
4
4
  Version = VERSION
5
5
  end
6
6
  end
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
@@ -59,4 +59,4 @@ Here is some source code.
59
59
  <p>content</p>
60
60
  </div>
61
61
  </div>
62
- </div>
62
+ </div>
@@ -1,3 +1,3 @@
1
1
  <div>
2
2
  <p>This test verifies the author can disable the document title by adding <code>:!showtitle:</code> to the document header.</p>
3
- </div>
3
+ </div>
@@ -52,4 +52,4 @@ like links and unordered lists, are fine:</p>
52
52
  </ul>
53
53
  <p>Tabs work too:</p>
54
54
  <p>test "tabbed code", -&gt;
55
- ok yes</p>
55
+ ok yes</p>