diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..9529e05 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Automatically add our team to each pull request in this repo +* @github/pages-reviewers diff --git a/.github/workflows/cibuild.yaml b/.github/workflows/cibuild.yaml new file mode 100644 index 0000000..bd81017 --- /dev/null +++ b/.github/workflows/cibuild.yaml @@ -0,0 +1,17 @@ +on: push +name: cibuild +jobs: + build: + name: Test + strategy: + matrix: + ruby: [2.6, 2.7] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - name: script/cibuild + run: script/cibuild diff --git a/.gitignore b/.gitignore index a9ab0c7..99b312d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ Gemfile.lock spec/dest .bundle +vendor/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a538dc5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: ruby -cache: bundler -rvm: - - 2.4 - - 2.3 -git: - depth: 1 - -sudo: false - -addons: - apt: - sources: - - kalakris-cmake - packages: - - cmake - -before_install: - - gem install bundler - -before_script: bundle update -script: script/cibuild diff --git a/README.md b/README.md index ee2242e..9145f77 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ *GitHub Flavored Markdown converter for Jekyll, based on [`jekyll-commonmark`](https://github.com/jekyll/jekyll-commonmark)* [![Gem Version](https://img.shields.io/gem/v/jekyll-commonmark-ghpages.svg)](https://rubygems.org/gems/jekyll-commonmark-ghpages) -[![Build Status](https://img.shields.io/travis/github/jekyll-commonmark-ghpages/master.svg)](https://travis-ci.org/github/jekyll-commonmark-ghpages) -[![Windows Build status](https://img.shields.io/appveyor/ci/github/jekyll-commonmark-ghpages/master.svg?label=Windows%20build)](https://ci.appveyor.com/project/github/jekyll-commonmark-ghpages) +[![Build Status](https://github.com/github/jekyll-commonmark-ghpages/actions/workflows/cibuild.yaml/badge.svg)](https://github.com/github/jekyll-commonmark-ghpages/actions/workflows/cibuild.yaml) Jekyll Markdown converter that uses [libcmark-gfm](https://github.com/github/cmark), GitHub's fork of [cmark](https://github.com/commonmark/cmark), the reference parser for CommonMark, with some additions to ensure compatibility with existing Kramdown-based sites. @@ -30,6 +29,8 @@ To specify extensions and options for use in converting Markdown to HTML, supply ```yaml commonmark: - options: ["SMART", "FOOTNOTES"] + options: ["UNSAFE", "SMART", "FOOTNOTES"] extensions: ["strikethrough", "autolink", "table", "tagfilter"] ``` + +⚠ The `UNSAFE` option is required for HTML rendering. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index ad534c8..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: "{build}" -clone_depth: 5 -build: off - -install: - - SET PATH=C:\Ruby%RUBY_FOLDER_VER%\bin;%PATH% - - bundle install --retry 5 --jobs=%NUMBER_OF_PROCESSORS% --clean --path vendor\bundle - -environment: - matrix: - - RUBY_FOLDER_VER: "24" - - RUBY_FOLDER_VER: "24-x64" - - RUBY_FOLDER_VER: "23" - - RUBY_FOLDER_VER: "22" - -test_script: - - ruby --version - - gem --version - - bundler --version - - bash script/cibuild - -cache: - - 'vendor\bundle -> appveyor.yml,Gemfile,jekyll-commonmark-ghpages.gemspec' diff --git a/jekyll-commonmark-ghpages.gemspec b/jekyll-commonmark-ghpages.gemspec index f40c60b..5fe9df0 100644 --- a/jekyll-commonmark-ghpages.gemspec +++ b/jekyll-commonmark-ghpages.gemspec @@ -3,9 +3,9 @@ Gem::Specification.new do |spec| spec.name = "jekyll-commonmark-ghpages" spec.summary = "CommonMark generator for Jekyll" - spec.version = "0.1.6" - spec.authors = ["Ashe Connor"] - spec.email = "kivikakk@github.com" + spec.version = "0.2.0" + spec.authors = ["GitHub, Inc."] + spec.email = "support@github.com" spec.homepage = "https://github.com/github/jekyll-commonmark-ghpages" spec.licenses = ["MIT"] @@ -14,8 +14,9 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "jekyll-commonmark", "~> 1.2" - spec.add_runtime_dependency "commonmarker", "~> 0.17.6" + spec.add_runtime_dependency "jekyll", "~> 3.9.0" + spec.add_runtime_dependency "jekyll-commonmark", "~> 1.4.0" + spec.add_runtime_dependency "commonmarker", "~> 0.23.4" spec.add_runtime_dependency "rouge", ">= 2.0", "< 4.0" spec.add_development_dependency "rspec", "~> 3.0" diff --git a/script/cibuild b/script/cibuild index 45d681a..c785b3f 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,3 +1,13 @@ #!/bin/bash +# Update gems +gem update --system 3.2.3 + +# Install bundler +gem install bundler + +# Install dependencies +bundle install + +# Run tests bundle exec rspec diff --git a/spec/test_spec.rb b/spec/test_spec.rb index 2391876..52892e1 100644 --- a/spec/test_spec.rb +++ b/spec/test_spec.rb @@ -21,7 +21,7 @@ let(:converter) { Jekyll::Converters::Markdown::CommonMarkGhPages.new(config) } let(:config) { {"commonmark" => { - "options" => ["SMART", "FOOTNOTES"], + "options" => ["UNSAFE", "SMART", "FOOTNOTES"], "extensions" => ["tagfilter"], }} } @@ -32,7 +32,7 @@ describe Jekyll::Renderer do it "should not re-process markdown in a liquid tag" do - site = Jekyll::Site.new(Jekyll.configuration("markdown" => "CommonMarkGhPages")) + site = Jekyll::Site.new(Jekyll.configuration("markdown" => "CommonMarkGhPages", "commonmark" => { "options" => ["UNSAFE"] })) collection = Jekyll::Collection.new(site, "pages") document = Jekyll::Document.new("hello.md", site: site, collection: collection) document.content = "**Hi**\n" \