html-pipeline 2.14.2 → 3.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +11 -3
  3. data/.github/dependabot.yml +20 -0
  4. data/.github/workflows/automerge.yml +34 -0
  5. data/.github/workflows/lint.yml +23 -0
  6. data/.github/workflows/tag_and_release.yml +70 -0
  7. data/.github/workflows/test.yml +33 -0
  8. data/.rubocop.yml +17 -0
  9. data/CHANGELOG.md +762 -180
  10. data/Gemfile +29 -15
  11. data/{LICENSE → LICENSE.txt} +2 -2
  12. data/README.md +209 -218
  13. data/Rakefile +14 -7
  14. data/UPGRADING.md +35 -0
  15. data/html-pipeline.gemspec +31 -21
  16. data/lib/html-pipeline.rb +3 -0
  17. data/lib/html_pipeline/convert_filter/markdown_filter.rb +26 -0
  18. data/lib/html_pipeline/convert_filter.rb +17 -0
  19. data/lib/html_pipeline/filter.rb +89 -0
  20. data/lib/{html/pipeline → html_pipeline/node_filter}/absolute_source_filter.rb +23 -21
  21. data/lib/{html/pipeline → html_pipeline/node_filter}/emoji_filter.rb +58 -54
  22. data/lib/html_pipeline/node_filter/https_filter.rb +22 -0
  23. data/lib/html_pipeline/node_filter/image_max_width_filter.rb +40 -0
  24. data/lib/{html/pipeline/@mention_filter.rb → html_pipeline/node_filter/mention_filter.rb} +55 -69
  25. data/lib/html_pipeline/node_filter/table_of_contents_filter.rb +68 -0
  26. data/lib/html_pipeline/node_filter/team_mention_filter.rb +105 -0
  27. data/lib/html_pipeline/node_filter.rb +31 -0
  28. data/lib/html_pipeline/sanitization_filter.rb +65 -0
  29. data/lib/{html/pipeline → html_pipeline/text_filter}/image_filter.rb +3 -3
  30. data/lib/{html/pipeline → html_pipeline/text_filter}/plain_text_input_filter.rb +3 -5
  31. data/lib/html_pipeline/text_filter.rb +21 -0
  32. data/lib/html_pipeline/version.rb +5 -0
  33. data/lib/html_pipeline.rb +252 -0
  34. metadata +52 -54
  35. data/.travis.yml +0 -43
  36. data/Appraisals +0 -19
  37. data/CONTRIBUTING.md +0 -60
  38. data/bin/html-pipeline +0 -78
  39. data/lib/html/pipeline/@team_mention_filter.rb +0 -99
  40. data/lib/html/pipeline/autolink_filter.rb +0 -34
  41. data/lib/html/pipeline/body_content.rb +0 -44
  42. data/lib/html/pipeline/camo_filter.rb +0 -105
  43. data/lib/html/pipeline/email_reply_filter.rb +0 -68
  44. data/lib/html/pipeline/filter.rb +0 -165
  45. data/lib/html/pipeline/https_filter.rb +0 -29
  46. data/lib/html/pipeline/image_max_width_filter.rb +0 -37
  47. data/lib/html/pipeline/markdown_filter.rb +0 -56
  48. data/lib/html/pipeline/sanitization_filter.rb +0 -144
  49. data/lib/html/pipeline/syntax_highlight_filter.rb +0 -50
  50. data/lib/html/pipeline/text_filter.rb +0 -16
  51. data/lib/html/pipeline/textile_filter.rb +0 -25
  52. data/lib/html/pipeline/toc_filter.rb +0 -69
  53. data/lib/html/pipeline/version.rb +0 -7
  54. data/lib/html/pipeline.rb +0 -210
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5ab7a15d6dfcc2c9cb5cf71ee9d547d1acf9ba51156ae7c0aded5eb87025d8f
4
- data.tar.gz: 1133be33a509b03ed5f957f58da33fe722bfc019020aa9db2a705d8bd6cdf815
3
+ metadata.gz: 4b8171e0970d8cbe50757505138bbea0f812c06583cfcdfd192686a8aff9cb53
4
+ data.tar.gz: 19a40ef93871f3d2b6411c526d6375a21d494a301d7a4abb2e92b6062de81b1c
5
5
  SHA512:
6
- metadata.gz: c9eae2effb543a36c039eb0a3b97fb7b54d0270ab102e3db2863a1f9cc632a0b470d33cb46efa5604531913bfbd2cea28dadbe47aa5f8e76c19376dd73f4f905
7
- data.tar.gz: cd86e9b3fcadb5e45d275fe3da678ec1a6ffd9b955551217641294fe941f100910660de3ebfbc5af47d55693e438cbb0424174750f1130b31b1be5dc2b92956f
6
+ metadata.gz: 4c160dcf8463cc5009d397529087c9f035cb3ae5e998c12ace03810fd8146b031f5f28829e318456239cd410d41fbf3d1da7d0b0e8097ceb3206733a96484c5f
7
+ data.tar.gz: 72fa1ec6b3a2097dd0ce6108f55a10ac9b617e5fc607e67818876c5b8ececbc7c2bbd58e53ce530ba39f11f6ad0c292ec956e9e42fbed370213abc5b71bcf257
data/.github/FUNDING.yml CHANGED
@@ -1,4 +1,12 @@
1
+ # These are supported funding model platforms
2
+
1
3
  github: gjtorikian
2
- patreon: gjtorikian
3
- open_collective: garen-torikian
4
- issuehunt: gjtorikian
4
+ # patreon: gjtorikian
5
+ # open_collective: garen-torikian
6
+ #ko_fi: # Replace with a single Ko-fi username
7
+ #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ #community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ #liberapay: # Replace with a single Liberapay username
10
+ # issuehunt: gjtorikian
11
+ #otechie: # Replace with a single Otechie username
12
+ #custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,20 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "09:00"
8
+ timezone: "Etc/UTC"
9
+ open-pull-requests-limit: 10
10
+
11
+ - package-ecosystem: "bundler"
12
+ directory: "/"
13
+ schedule:
14
+ interval: daily
15
+ time: "09:00"
16
+ timezone: "Etc/UTC"
17
+ open-pull-requests-limit: 10
18
+ allow:
19
+ - dependency-name: "*"
20
+ dependency-type: "production"
@@ -0,0 +1,34 @@
1
+ name: PR auto-{approve,merge}
2
+
3
+ on:
4
+ pull_request_target:
5
+
6
+ permissions:
7
+ pull-requests: write
8
+ contents: write
9
+
10
+ jobs:
11
+ dependabot:
12
+ name: Dependabot
13
+ runs-on: ubuntu-latest
14
+
15
+ if: ${{ github.actor == 'dependabot[bot]' }}
16
+ steps:
17
+ - name: Fetch Dependabot metadata
18
+ id: dependabot-metadata
19
+ uses: dependabot/fetch-metadata@v1
20
+ with:
21
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
22
+
23
+ - name: Approve Dependabot PR
24
+ if: ${{steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'}}
25
+ run: gh pr review --approve "$PR_URL"
26
+ env:
27
+ PR_URL: ${{github.event.pull_request.html_url}}
28
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
+
30
+ - name: Merge Dependabot PR
31
+ run: gh pr merge --auto --squash "$PR_URL"
32
+ env:
33
+ PR_URL: ${{ github.event.pull_request.html_url }}
34
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,23 @@
1
+ name: Linting
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - "**/*.rb"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: 3.1.0
19
+ rubygems: latest
20
+ bundler-cache: true
21
+ - run: bundle install
22
+ - name: Rubocop
23
+ run: bundle exec rake rubocop
@@ -0,0 +1,70 @@
1
+ name: Tag and Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ paths:
9
+ - "lib/html_pipeline/version.rb"
10
+
11
+ jobs:
12
+ release:
13
+ env:
14
+ GEM_NAME: html-pipeline
15
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_BOT_KEY }}
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+
21
+ - name: Set up Ruby 3.1
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: 3.1
25
+ bundler-cache: true
26
+
27
+ - name: Configure Git
28
+ run: |
29
+ git config --local user.email "actions@github.com"
30
+ git config --local user.name "Actions Auto Build"
31
+
32
+ - name: Get current version
33
+ id: version-label
34
+ run: |
35
+ VERSION=$(grep VERSION lib/html_pipeline/version.rb | head -n 1 | cut -d'"' -f2)
36
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
37
+
38
+ - name: Create tag
39
+ run: |
40
+ git tag -a v${{ steps.version-label.outputs.version }} -m "Release v${{ steps.version-label.outputs.version }}"
41
+ git push origin --tags
42
+
43
+ - name: Generate CHANGELOG.md
44
+ id: changelog
45
+ run: script/generate_changelog
46
+
47
+ - name: Commit & Push Changelog
48
+ run: |
49
+ git config --local user.email "actions@github.com"
50
+ git config --local user.name "Actions Auto Build"
51
+ git add -f CHANGELOG.md
52
+ git commit -m "docs: update changelog" || true
53
+ git push
54
+
55
+ - name: Publish release
56
+ env:
57
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+ run: |
59
+ gh release create v${{ steps.version-label.outputs.version }} --generate-notes
60
+
61
+ - name: Publish to RubyGems
62
+ run: |
63
+ mkdir -p $HOME/.gem
64
+ touch $HOME/.gem/credentials
65
+ chmod 0600 $HOME/.gem/credentials
66
+ printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_BOT_KEY}\n" > $HOME/.gem/credentials
67
+ bundle exec rake package
68
+ for gem in pkg/html-pipeline-${{ steps.version-label.outputs.version }}*.gem ; do
69
+ gem push "$gem" --host https://rubygems.org
70
+ done
@@ -0,0 +1,33 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ fail-fast: true
15
+ matrix:
16
+ ruby-version:
17
+ - 3.1.0
18
+
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+
22
+ - name: Set up Ruby ${{ matrix.ruby-version }}
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: ${{ matrix.ruby-version }}
26
+ rubygems: latest
27
+ bundler-cache: true
28
+
29
+ - name: Install dependencies
30
+ run: bundle install
31
+
32
+ - name: Run tests
33
+ run: bundle exec rake test
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ inherit_gem:
2
+ rubocop-standard:
3
+ - config/default.yml
4
+ - config/minitest.yml
5
+
6
+ inherit_mode:
7
+ merge:
8
+ - Exclude
9
+
10
+ AllCops:
11
+ Exclude:
12
+ - test/progit/**/*
13
+ - "pkg/**/*"
14
+ - "ext/**/*"
15
+ - "vendor/**/*"
16
+ - "tmp/**/*"
17
+ - "test/progit/**/*"