Skip to content

Commit

Permalink
Merge branch 'master' into align
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored Nov 30, 2024
2 parents fa8bceb + 6f4f436 commit 3c67882
Show file tree
Hide file tree
Showing 28 changed files with 2,940 additions and 79 deletions.
39 changes: 39 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -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'
21 changes: 12 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,39 @@ on: [push, pull_request]
env:
JRUBY_OPTS: -Xcext.enabled=true

permissions:
contents: read

jobs:
build:
name: "Test / Ruby ${{ matrix.ruby }}"
runs-on: ubuntu-latest
strategy:
matrix:
ruby:
- "2.4"
- "2.5"
- "2.6"
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
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@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5.3.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.1.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
*.pyc
pkg/
.bundle
Gemfile.lock
.project
.buildpath
*~
*~
vendor/
.DS_Store
.venv
venv
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This library's only job is to decide which markup format to use and call out to
If you are having an issue with:

* **Syntax highlighting** - see [github/linguist](https://github.com/github/linguist/blob/master/CONTRIBUTING.md#fixing-syntax-highlighting)
* **Markdown on GitHub** - contact support@github.com
* **Markdown on GitHub** - contact [GitHub Support](https://support.github.com/)
* **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

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.
Expand Down
14 changes: 8 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
source "http://rubygems.org"
source "https://rubygems.org"
gemspec

gem "posix-spawn", :platforms => :ruby
gem "redcarpet", :platforms => :ruby
gem "kramdown", :platforms => :jruby
gem "RedCloth"
gem "commonmarker", "~> 0.18.1"
gem "rdoc", "~>3.6"
gem "org-ruby", "= 0.9.9"
gem "creole", "~>0.3.6"
# 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.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"
139 changes: 139 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
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)
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.3.0)
bigdecimal (3.1.8)
builder (3.3.0)
cgi (0.4.1)
charlock_holmes (0.7.7)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
creole (0.5.0)
drb (2.2.1)
expression_parser (0.9.0)
github-linguist (7.30.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.6)
concurrent-ruby (~> 1.0)
logger (1.6.1)
mini_mime (1.1.5)
minitest (5.25.1)
mutex_m (0.2.0)
nokogiri (1.16.7-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm-linux)
racc (~> 1.4)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86-linux)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
nokogiri-diff (0.3.0)
nokogiri (~> 1.5)
tdiff (~> 0.4)
org-ruby (0.9.12)
rubypants (~> 0.2)
psych (5.1.2)
stringio
racc (1.8.1)
rake (13.2.1)
rdoc (6.7.0)
psych (>= 4.0.0)
redcarpet (3.6.0)
rexml (3.3.9)
ruby-enum (0.9.0)
i18n
rubypants (0.7.1)
rugged (1.7.2)
sanitize (6.1.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
securerandom (0.3.1)
stringio (3.1.1)
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.16.5)
nokogiri-diff (~> 0.3.0)
org-ruby (= 0.9.12)
rake
rdoc (~> 6.7.0)
redcarpet
rexml
sanitize (>= 4.6.3)
twitter-text (~> 1.14)
wikicloth (= 0.8.3)

BUNDLED WITH
2.5.9
16 changes: 16 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 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
* Bump nokogiri-diff from 0.2.0 to 0.3.0
* Bump rdoc from 3.6 to 6.7.0
* Update CommandImplementation to better support large files (affecting RST and POD6 rendering)

## 4.0.2 - 2023-10-10
* Add support for .mdx files in markdown

## 4.0.1 - 2022-03-07
* 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)

## 4.0.0 - 2021-03-31

* Drop support for Python 2 in RST rendering [#1456](https://github.com/github/markup/pull/1456)
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
------------
Expand Down
9 changes: 5 additions & 4 deletions github-markup.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ Gem::Specification.new do |s|
s.homepage = "https://github.com/github/markup"
s.license = "MIT"

s.required_ruby_version = '>= 3.0.0'

s.files = `git ls-files`.split($\)
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 '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.8.1'
s.add_development_dependency 'nokogiri-diff', '~> 0.2.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.1.3"
end
2 changes: 1 addition & 1 deletion lib/github-markup.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module GitHub
module Markup
VERSION = '4.0.0'
VERSION = '5.0.1'
Version = VERSION
end
end
4 changes: 2 additions & 2 deletions lib/github/commands/rest2html
Original file line number Diff line number Diff line change
Expand Up @@ -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('<a name="%s"></a>\n' % id_attribute)
for id_attribute in node.attributes['ids']:
self.body.append('<a name="%s"></a>\n' % id_attribute)
self.section_level += 1

def depart_section(self, node):
Expand Down
Loading

0 comments on commit 3c67882

Please sign in to comment.