diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 52d4db54..722c3360 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -11,10 +11,9 @@ jobs:
strategy:
matrix:
ruby:
- - "2.4"
- - "2.5"
- - "2.6"
- - "2.7"
+ - "3.1"
+ - "3.2"
+ - "3.3"
fail-fast: false
steps:
diff --git a/.ruby-version b/.ruby-version
new file mode 100644
index 00000000..47725433
--- /dev/null
+++ b/.ruby-version
@@ -0,0 +1 @@
+3.3.2
diff --git a/Gemfile b/Gemfile
index c98072f2..864416c2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -7,11 +7,10 @@ gem "kramdown", :platforms => :jruby
gem "RedCloth"
# using a tag version here because 0.18.3 was not published by the author to encourage users to upgrade.
# however we want to bump up to this version since this has a security patch
-gem "commonmarker", git: "https://github.com/gjtorikian/commonmarker.git", tag: "v0.18.3"
-gem "rdoc", "~>3.6"
-gem "org-ruby", "= 0.9.9"
-gem "creole", "~>0.3.6"
-gem "wikicloth", "=0.8.3"
-gem "twitter-text", "~> 1.14"
-gem "asciidoctor", "~> 2.0.5"
+gem "commonmarker", git: "https://github.com/gjtorikian/commonmarker.git", tag: "v1.1.4"
+gem "rdoc", "~> 6.7.0"
+gem "org-ruby", "= 0.9.12"
+gem "creole", "~> 0.5.0"
+gem "rexml"
+gem "asciidoctor", "~> 2.0.23"
gem "rake"
diff --git a/HISTORY.md b/HISTORY.md
index 57145177..9a2f8744 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,3 +1,14 @@
+## 5.0.0 - 2024-06-11
+* Drop support for Ruby versions < 3.1.0
+
+* activesupport to 7.1.3.4
+* minitest to 5.23.1
+* nokogiri to 1.16.5
+* nokogiri-diff to 0.3.0
+* github-linguist to 7.30.0
+* sanitize to 6.1.0
+* html-pipeline to 2.14.3
+
## 4.0.2 - 2023-10-10
* Add support for .mdx files in markdown
diff --git a/README.md b/README.md
index b2bcc809..69a64918 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,8 @@ you wish to run the library. You can also run `script/bootstrap` to fetch them a
* [.org](http://orgmode.org/) -- `gem install org-ruby` (https://github.com/wallyqs/org-ruby)
* [.creole](http://wikicreole.org/) -- `gem install creole` (https://github.com/larsch/creole)
* [.mediawiki, .wiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `gem install wikicloth` (https://github.com/nricciar/wikicloth)
+ - Note: The currently released version of `wikicloth`, `0.8.3`, is not
+ compatible with the latest version of this gem.
* [.rst](http://docutils.sourceforge.net/rst.html) -- `pip install docutils`
* [.asciidoc, .adoc, .asc](http://asciidoc.org/) -- `gem install asciidoctor` (http://asciidoctor.org)
* [.pod](http://search.cpan.org/dist/perl/pod/perlpod.pod) -- `Pod::Simple::XHTML`
diff --git a/github-markup.gemspec b/github-markup.gemspec
index 594d3507..e36adfa8 100644
--- a/github-markup.gemspec
+++ b/github-markup.gemspec
@@ -14,17 +14,17 @@ Gem::Specification.new do |s|
s.license = "MIT"
s.files = `git ls-files`.split($\)
- s.files += Dir['vendor/**/*']
+ s.files += Dir["vendor/**/*"]
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = %w[lib]
- s.add_development_dependency 'rake', '~> 12'
- s.add_development_dependency 'activesupport', '~> 4.0'
- s.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
- s.add_development_dependency 'html-pipeline', '~> 1.0'
- s.add_development_dependency 'sanitize', '>= 4.6.3'
- s.add_development_dependency 'nokogiri', '~> 1.8.1'
- s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
- s.add_development_dependency "github-linguist", ">= 7.1.3"
+ s.add_development_dependency "rake", "~> 12"
+ s.add_development_dependency "activesupport", "~> 7.1.3.4"
+ s.add_development_dependency "minitest", "~> 5.23.1"
+ s.add_development_dependency "html-pipeline", "~> 2.14.3"
+ s.add_development_dependency "sanitize", "~> 6.1.0"
+ s.add_development_dependency "nokogiri", "~> 1.16.5"
+ s.add_development_dependency "nokogiri-diff", "~> 0.3.0"
+ s.add_development_dependency "github-linguist", "~> 7.30.0"
end
diff --git a/lib/github-markup.rb b/lib/github-markup.rb
index 58f9b1c5..646e341c 100644
--- a/lib/github-markup.rb
+++ b/lib/github-markup.rb
@@ -1,6 +1,6 @@
module GitHub
module Markup
- VERSION = '4.0.2'
+ VERSION = '5.0.0'
Version = VERSION
end
end
diff --git a/lib/github/markup/markdown.rb b/lib/github/markup/markdown.rb
index dcf93229..df4a5d93 100644
--- a/lib/github/markup/markdown.rb
+++ b/lib/github/markup/markdown.rb
@@ -7,7 +7,13 @@ class Markdown < Implementation
"commonmarker" => proc { |content, options: {}|
commonmarker_opts = [:GITHUB_PRE_LANG].concat(options.fetch(:commonmarker_opts, []))
commonmarker_exts = options.fetch(:commonmarker_exts, [:tagfilter, :autolink, :table, :strikethrough])
- CommonMarker.render_html(content, commonmarker_opts, commonmarker_exts)
+ Commonmarker.to_html(
+ content,
+ options: {
+ render: commonmarker_opts.map { |opt| [opt.downcase, true] }.to_h,
+ extension: commonmarker_exts.map { |ext| [ext.downcase, true] }.to_h,
+ },
+ )
},
"github/markdown" => proc { |content, options: {}|
GitHub::Markdown.render(content)
diff --git a/test/markup_test.rb b/test/markup_test.rb
index 24e78000..5590690c 100644
--- a/test/markup_test.rb
+++ b/test/markup_test.rb
@@ -51,7 +51,6 @@ def call
markup = readme.split('/').last.gsub(/^README\./, '')
define_method "test_#{markup}" do
- skip "Skipping MediaWiki test because wikicloth is currently not compatible with JRuby." if markup == "mediawiki" && RUBY_PLATFORM == "java"
source = File.read(readme)
expected_file = "#{readme}.html"
expected = File.read(expected_file).rstrip
@@ -66,6 +65,7 @@ def call
f.close_write
f.read
end
+
assert_html_equal expected, actual, < hello world hello hello world hello hello world hello hello world hello content This test verifies the author can disable the document title by adding Taken from https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee comment comment now with a... ... broken up ... ... nested block. Code must be separated from text by a blank line. The next line is part of the text and will not be executed.
fail() Code in Regular Markdown features,
like links and unordered lists, are fine: Tabs work too: test "tabbed code", ->
-ok yesAnother Section
:!showtitle:
to the document header.Literate CoffeeScript Test
+test "basic literate CoffeeScript parsing", ->
- ok yes
-
test "basic literate CoffeeScript parsing", ->
+ ok yes
+
+test "broken up indentation", ->
-
test "broken up indentation", ->
+
+ do ->
-
do ->
+
+ ok yes
-
ok yes
+
+test "code blocks must be preceded by a blank line", ->
-
test "code blocks must be preceded by a blank line", ->
+
+ ok yes
-
ok yes
+
backticks is not parsed
and...
+test "comments in indented blocks work", ->
- do ->
- do ->
- # Regular comment.
-
- ###
- Block comment.
- ###
-
- ok yes
-
test "comments in indented blocks work", ->
+ do ->
+ do ->
+ # Regular comment.
+
+ ###
+ Block comment.
+ ###
+
+ ok yes
+
@@ -52,4 +52,4 @@
Literate CoffeeScript Test
a-b- -JRuby has long had a private embedding API, which was closely tied to the runtime's internals and therefore changed frequently as JRuby evolved. Since version 1.4, however, we have also provided a more stable public API, known as Red Bridge or JRuby Embed. Existing Java programs written to the [[DirectJRubyEmbedding|legacy API]] should still work, but we strongly recommend Red Bridge for all new projects. - -== Features of Red Bridge == -Red Bridge consists of two layers: Embed Core on the bottom, and implementations of [http://www.jcp.org/en/jsr/detail?id=223 JSR223] and [http://jakarta.apache.org/bsf/ BSF] on top. Embed Core is JRuby-specific, and can take advantage of much of JRuby's power. JSR223 and BSF are more general interfaces that provide a common ground across scripting languages. - -Which API should you use? For projects where Ruby is the only scripting language involved, we recommend Embed Core for the following reasons: - -# With Embed Core, you can create several Ruby environments in one JVM, and configure them individually (via
org.jruby.RubyInstanceConfig
. With the other APIs, configuration options can only be set globally, via the System
properties.
-# Embed Core offers several shortcuts, such as loading scripts from a java.io.InputStream
, or returning Java-friendly objects from Ruby code. These allow you to skip a lot of boilerplate.
-
-For projects requiring multiple scripting languages, JSR223 is a good fit. Though the API is language-independent, JRuby's implementation of it allows you to set some Ruby-specific options. In particular, you can control the threading model of the scripting engine, the lifetime of local variables, compilation mode, and how line numbers are displayed.
-
-The full [http://jruby-embed.kenai.com/docs/ API documentation] has all the gory details. It's worth talking about a couple of the finer points here.
-
-= Previous Embedding JRuby Page=
-We recommend using Embed Core; however, if you're maintaining code that uses the old API, you can find its documentation on the [[JavaIntegration|legacy embedding]]This link goes nowhere. page.
-
-= References =
-» JRuby Project Wiki Home Page -
-Table of Contents |
one-<two -
a-b- - -
JRuby has long had a private embedding API, which was closely tied to the runtime's internals and therefore changed frequently as JRuby evolved. Since version 1.4, however, we have also provided a more stable public API, known as Red Bridge or JRuby Embed. Existing Java programs written to the legacy API should still work, but we strongly recommend Red Bridge for all new projects. -
- -Red Bridge consists of two layers: Embed Core on the bottom, and implementations of JSR223 and BSF on top. Embed Core is JRuby-specific, and can take advantage of much of JRuby's power. JSR223 and BSF are more general interfaces that provide a common ground across scripting languages. -
-Which API should you use? For projects where Ruby is the only scripting language involved, we recommend Embed Core for the following reasons: -
- - - -org.jruby.RubyInstanceConfig
. With the other APIs, configuration options can only be set globally, via the System
properties.java.io.InputStream
, or returning Java-friendly objects from Ruby code. These allow you to skip a lot of boilerplate.The full API documentation has all the gory details. It's worth talking about a couple of the finer points here. -
- -We recommend using Embed Core; however, if you're maintaining code that uses the old API, you can find its documentation on the legacy embedding[1] page. -
- -Helpful Ruby routines for parsing orgmode files. The most significant thing this library does today is convert orgmode files to textile. Currently, you cannot do much to customize the conversion. The supplied textile conversion is optimized for extracting “content” from the orgfile as opposed to “metadata.”
-#+INCLUDE:
is not supportedto_html
output on the parser.code
, verbatim
, underline, code
, verbatim
, underline, diff --git a/test/markups/README.pod.html b/test/markups/README.pod.html index a62c65db..63caf6bc 100644 --- a/test/markups/README.pod.html +++ b/test/markups/README.pod.html @@ -10,7 +10,8 @@ABOUT
Create a working compiler that understands the majority of the MATLAB/Octave programming language.
+Create a working compiler that understands the majority of the MATLAB/Octave programming language.
The first is the parser, located in the src/parser/
directory. The parser proper is composed of three source files, grammar.pg which is a Perl6Grammar file, and actions.pm which is the associated actions file written in NQP, and grammar-oper.pm which is the operator precedence parser. In addition, several helper functions used by the parser are located in src/internals
.
The first is the parser, located in the src/parser/
directory. The parser proper is composed of three source files, grammar.pg which is a Perl6Grammar file, and actions.pm which is the associated actions file written in NQP, and grammar-oper.pm which is the operator precedence parser. In addition, several helper functions used by the parser are located in src/internals
.
The second component is the library of builtin functions in the src/builtins/
directory. These functions are, currently, written primarily in PIR. Function names prefixed with an underscore are "private" functions for use with the parser. Other functions should have names which are the same as names for regular MATLAB or Octave functions, since they will be available to the HLL. These are also separated into different namespaces depending on visibility and utility.
The second component is the library of builtin functions in the src/builtins/
directory. These functions are, currently, written primarily in PIR. Function names prefixed with an underscore are "private" functions for use with the parser. Other functions should have names which are the same as names for regular MATLAB or Octave functions, since they will be available to the HLL. These are also separated into different namespaces depending on visibility and utility.
A number of library functions are written in M, or mostly M with some inline PIR code in toolbox/
.
A number of library functions are written in M, or mostly M with some inline PIR code in toolbox/
.
Example text.
Table of Contents
+The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.
Press Ctrl+C to quit
- -RAW HTML!
p {color:blue;} \ No newline at end of file +RAW HTML!
p {color:blue;} \ No newline at end of file diff --git a/test/markups/README.toc.asciidoc.html b/test/markups/README.toc.asciidoc.html index e6f598cf..4e32869a 100644 --- a/test/markups/README.toc.asciidoc.html +++ b/test/markups/README.toc.asciidoc.html @@ -43,4 +43,4 @@Contents
+pycparser is unique in the sense that it's written in pure Python - a very high level language that's easy to experiment with and tweak. To people familiar -with Lex and Yacc, pycparser's code will be simple to understand.
+with Lex and Yacc, pycparser's code will be simple to understand. \ No newline at end of file