diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 00000000..802b7513 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,39 @@ +--- +version: 2 +updates: + - package-ecosystem: 'bundler' + directory: '/' + schedule: + interval: 'weekly' + commit-message: + prefix: 'chore(deps)' + groups: + dependencies: + applies-to: version-updates + update-types: + - 'minor' + - 'patch' + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'weekly' + commit-message: + prefix: 'chore(deps)' + groups: + dependencies: + applies-to: version-updates + update-types: + - 'minor' + - 'patch' + - package-ecosystem: 'docker' + directory: '/' + schedule: + interval: 'weekly' + commit-message: + prefix: 'chore(deps)' + groups: + dependencies: + applies-to: version-updates + update-types: + - 'minor' + - 'patch' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a25fdefc..50ccc50b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,9 @@ on: [push, pull_request] env: JRUBY_OPTS: -Xcext.enabled=true +permissions: + contents: read + jobs: build: name: "Test / Ruby ${{ matrix.ruby }}" @@ -11,29 +14,29 @@ jobs: strategy: matrix: ruby: - - "3.0" - "3.1" - "3.2" - "3.3" + - "3.4" fail-fast: false steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4.2.2 with: fetch-depth: 10 - - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5.5.0 with: # This should match lib/github/markups.rb GitHub::Markups::MARKUP_RST - python-version: '3.x' + python-version: "3.x" - - uses: actions/cache@v2 + - uses: actions/cache@v4.2.3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..84cbf0ed --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,27 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "0 12 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v9.1.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: > + This issue has been automatically marked as stale because it has not + had recent activity. It will be closed if no further activity occurs. + Thank you for your contributions. + stale-pr-message: > + This pull request has been automatically marked as stale because it has not + had recent activity. It will be closed if no further activity occurs. + Thank you for your contributions. + exempt-issue-labels: keep + exempt-pr-labels: keep diff --git a/.gitignore b/.gitignore index c93c0b18..b0f0821c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ *.pyc pkg/ .bundle -Gemfile.lock .project .buildpath *~ vendor/ +.DS_Store +.venv +venv diff --git a/Gemfile b/Gemfile index fb3c1308..60920bee 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "http://rubygems.org" +source "https://rubygems.org" gemspec gem "redcarpet", :platforms => :ruby @@ -7,11 +7,12 @@ 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", "~> 6.7.0" -gem "org-ruby", "= 0.9.9" -gem "creole", "~>0.3.6" +gem "rdoc", "~> 6.13.1" +gem "org-ruby", "0.9.12" +gem "creole", "~>0.5.0" gem "wikicloth", "=0.8.3" gem "twitter-text", "~> 1.14" gem "asciidoctor", "~> 2.0.5" gem "rake" gem "rexml" +gem "nokogiri", "~> 1.18.8" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..9ee4b029 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,143 @@ +GIT + remote: https://github.com/gjtorikian/commonmarker.git + revision: 2838ebaa83ee0081d481c21f3bc0e4cb3e8de9da + tag: v0.18.3 + specs: + commonmarker (0.18.3) + ruby-enum (~> 0.5) + +PATH + remote: . + specs: + github-markup (5.0.1) + +GEM + remote: https://rubygems.org/ + specs: + RedCloth (4.3.4) + activesupport (7.1.5.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + mutex_m + securerandom (>= 0.3) + tzinfo (~> 2.0) + asciidoctor (2.0.23) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.9) + builder (3.3.0) + cgi (0.4.2) + charlock_holmes (0.7.9) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + crass (1.0.6) + creole (0.5.0) + date (3.4.1) + drb (2.2.1) + expression_parser (0.9.0) + github-linguist (9.1.0) + cgi + charlock_holmes (~> 0.7.7) + mini_mime (~> 1.0) + rugged (~> 1.0) + html-pipeline (1.11.0) + activesupport (>= 2) + nokogiri (~> 1.4) + htmlentities (4.3.4) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + logger (1.7.0) + mini_mime (1.1.5) + mini_portile2 (2.8.8) + minitest (5.25.5) + mutex_m (0.3.0) + nokogiri (1.18.8) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + nokogiri (1.18.8-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.8-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.8-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.8-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.8-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri-diff (0.3.0) + nokogiri (~> 1.5) + tdiff (~> 0.4) + org-ruby (0.9.12) + rubypants (~> 0.2) + psych (5.2.3) + date + stringio + racc (1.8.1) + rake (13.2.1) + rdoc (6.13.1) + psych (>= 4.0.0) + redcarpet (3.6.1) + rexml (3.4.1) + ruby-enum (0.9.0) + i18n + rubypants (0.7.1) + rugged (1.9.0) + sanitize (6.1.3) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + securerandom (0.3.2) + stringio (3.1.6) + tdiff (0.4.0) + twitter-text (1.14.7) + unf (~> 0.1.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.9.1) + wikicloth (0.8.3) + builder + expression_parser + htmlentities + nokogiri + twitter-text + +PLATFORMS + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux + +DEPENDENCIES + RedCloth + activesupport (~> 7.1.5) + asciidoctor (~> 2.0.5) + commonmarker! + creole (~> 0.5.0) + github-linguist (>= 7.1.3) + github-markup! + html-pipeline (~> 1.0) + kramdown + minitest (~> 5.4, >= 5.4.3) + nokogiri (~> 1.18.8) + nokogiri-diff (~> 0.3.0) + org-ruby (= 0.9.12) + rake + rdoc (~> 6.13.1) + redcarpet + rexml + sanitize (>= 4.6.3) + twitter-text (~> 1.14) + wikicloth (= 0.8.3) + +BUNDLED WITH + 2.5.9 diff --git a/HISTORY.md b/HISTORY.md index 0e01f49c..745a9c1b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,6 @@ +## 5.0.1 - 2024-06-17 +* Bump activesupport from 4.0 to 7.1.3.4 + ## 5.0.0 - 2024-06-17 * Drop support for Ruby versions < 3 * Bump nokogiri from 1.8.1 to 1.16.5 diff --git a/README.md b/README.md index b2bcc809..12188dcb 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The following markups are supported. The dependencies listed are required if you wish to run the library. You can also run `script/bootstrap` to fetch them all. * [.markdown, .mdown, .mkdn, .md](http://daringfireball.net/projects/markdown/) -- `gem install commonmarker` (https://github.com/gjtorikian/commonmarker) -* [.textile](https://www.promptworks.com/textile) -- `gem install RedCloth` (https://github.com/jgarber/redcloth) +* [.textile](https://textile-lang.com/) -- `gem install RedCloth` (https://github.com/jgarber/redcloth) * [.rdoc](https://ruby.github.io/rdoc/) -- `gem install rdoc -v 3.6.1` * [.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) @@ -72,6 +72,15 @@ require 'github/markup' GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "* One\n* Two") ``` +Local Development +----------------- + +```sh +python3 -m venv .venv +source .venv/bin/activate +cd script +./bootstrap +``` Contributing ------------ diff --git a/github-markup.gemspec b/github-markup.gemspec index 4818706d..4329a901 100644 --- a/github-markup.gemspec +++ b/github-markup.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/github/markup" s.license = "MIT" - s.required_ruby_version = '>= 3.0.0' + s.required_ruby_version = '>= 3.1.0' s.files = `git ls-files`.split($\) s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) } @@ -21,11 +21,11 @@ Gem::Specification.new do |s| s.require_paths = %w[lib] s.add_development_dependency 'rake', '~> 12' - s.add_development_dependency 'activesupport', '~> 4.0' + s.add_development_dependency 'activesupport', '~> 7.1.5' 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.16.5' + s.add_development_dependency 'nokogiri', '~> 1.18.4' s.add_development_dependency 'nokogiri-diff', '~> 0.3.0' s.add_development_dependency "github-linguist", ">= 7.1.3" end diff --git a/lib/github-markup.rb b/lib/github-markup.rb index 646e341c..7c36ad17 100644 --- a/lib/github-markup.rb +++ b/lib/github-markup.rb @@ -1,6 +1,6 @@ module GitHub module Markup - VERSION = '5.0.0' + VERSION = '5.0.1' Version = VERSION end end diff --git a/lib/github/commands/rest2html b/lib/github/commands/rest2html index c7c89dce..c6fc663e 100755 --- a/lib/github/commands/rest2html +++ b/lib/github/commands/rest2html @@ -199,8 +199,8 @@ class GitHubHTMLTranslator(HTMLTranslator): # see also: http://bit.ly/NHtyRx # the a is to support ::contents with ::sectnums: http://git.io/N1yC def visit_section(self, node): - id_attribute = node.attributes['ids'][0] - self.body.append('\n' % id_attribute) + for id_attribute in node.attributes['ids']: + self.body.append('\n' % id_attribute) self.section_level += 1 def depart_section(self, node): diff --git a/test/markups/README.org b/test/markups/README.org index dded60e3..0eca800a 100644 --- a/test/markups/README.org +++ b/test/markups/README.org @@ -58,7 +58,7 @@ end - Skipping text before the first headline (option skip:t) - Skipping tables (option |:nil) - Custom todo keywords - - EXPORT_SELECT_TAGS and EXPORT_EXLUDE_TAGS for controlling parts of + - EXPORT_SELECT_TAGS and EXPORT_EXCLUDE_TAGS for controlling parts of the tree to export - Rewrite "file:(blah).org" links to "http:(blah).html" links. This makes the inter-links to other org-mode files work. diff --git a/test/markups/README.org.html b/test/markups/README.org.html index ddf8b27e..458024af 100644 --- a/test/markups/README.org.html +++ b/test/markups/README.org.html @@ -52,7 +52,7 @@
code
blahcode
, hoorayThe UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.