html-pipeline 2.14.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +11 -3
  3. data/.github/dependabot.yml +27 -0
  4. data/.github/workflows/automerge.yml +13 -0
  5. data/.github/workflows/ci.yml +22 -0
  6. data/.github/workflows/lint.yml +23 -0
  7. data/.github/workflows/publish.yml +19 -0
  8. data/.rubocop.yml +17 -0
  9. data/.ruby-version +1 -0
  10. data/.vscode/settings.json +8 -0
  11. data/CHANGELOG.md +82 -2
  12. data/Gemfile +31 -15
  13. data/{LICENSE → LICENSE.txt} +2 -2
  14. data/README.md +240 -223
  15. data/Rakefile +14 -7
  16. data/UPGRADING.md +34 -0
  17. data/html-pipeline.gemspec +31 -21
  18. data/lib/html-pipeline.rb +3 -0
  19. data/lib/html_pipeline/convert_filter/markdown_filter.rb +26 -0
  20. data/lib/html_pipeline/convert_filter.rb +17 -0
  21. data/lib/html_pipeline/filter.rb +89 -0
  22. data/lib/html_pipeline/node_filter/absolute_source_filter.rb +54 -0
  23. data/lib/html_pipeline/node_filter/asset_proxy_filter.rb +86 -0
  24. data/lib/{html/pipeline → html_pipeline/node_filter}/emoji_filter.rb +58 -54
  25. data/lib/html_pipeline/node_filter/https_filter.rb +22 -0
  26. data/lib/html_pipeline/node_filter/image_max_width_filter.rb +40 -0
  27. data/lib/{html/pipeline/@mention_filter.rb → html_pipeline/node_filter/mention_filter.rb} +54 -68
  28. data/lib/html_pipeline/node_filter/syntax_highlight_filter.rb +62 -0
  29. data/lib/html_pipeline/node_filter/table_of_contents_filter.rb +70 -0
  30. data/lib/html_pipeline/node_filter/team_mention_filter.rb +105 -0
  31. data/lib/html_pipeline/node_filter.rb +31 -0
  32. data/lib/html_pipeline/sanitization_filter.rb +188 -0
  33. data/lib/{html/pipeline → html_pipeline/text_filter}/image_filter.rb +3 -3
  34. data/lib/{html/pipeline → html_pipeline/text_filter}/plain_text_input_filter.rb +3 -5
  35. data/lib/html_pipeline/text_filter.rb +21 -0
  36. data/lib/html_pipeline/version.rb +5 -0
  37. data/lib/html_pipeline.rb +267 -0
  38. metadata +58 -54
  39. data/.travis.yml +0 -43
  40. data/Appraisals +0 -19
  41. data/CONTRIBUTING.md +0 -60
  42. data/bin/html-pipeline +0 -78
  43. data/lib/html/pipeline/@team_mention_filter.rb +0 -99
  44. data/lib/html/pipeline/absolute_source_filter.rb +0 -52
  45. data/lib/html/pipeline/autolink_filter.rb +0 -34
  46. data/lib/html/pipeline/body_content.rb +0 -44
  47. data/lib/html/pipeline/camo_filter.rb +0 -105
  48. data/lib/html/pipeline/email_reply_filter.rb +0 -69
  49. data/lib/html/pipeline/filter.rb +0 -165
  50. data/lib/html/pipeline/https_filter.rb +0 -29
  51. data/lib/html/pipeline/image_max_width_filter.rb +0 -37
  52. data/lib/html/pipeline/markdown_filter.rb +0 -56
  53. data/lib/html/pipeline/sanitization_filter.rb +0 -144
  54. data/lib/html/pipeline/syntax_highlight_filter.rb +0 -50
  55. data/lib/html/pipeline/text_filter.rb +0 -16
  56. data/lib/html/pipeline/textile_filter.rb +0 -25
  57. data/lib/html/pipeline/toc_filter.rb +0 -69
  58. data/lib/html/pipeline/version.rb +0 -7
  59. data/lib/html/pipeline.rb +0 -210
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b77953747de81d288810b41b16c299b990dd813227a4576875d82f8f060c74c
4
- data.tar.gz: 72c30128725915cf4c88f4c12564c7aa07a4587def81cff7b29584d1c5b48a5e
3
+ metadata.gz: 248d46dd59af87c501118e123ac1ffa5e16447942ca892a9b4985e0fa43c6548
4
+ data.tar.gz: 48a75cb97c189f4da648df25121e96efd4a9a278081c6ddd75c129c86f4fcbdd
5
5
  SHA512:
6
- metadata.gz: 67ceedf941f4147087a88ea7801382126a6a6eb5af8dc9cd4d7ff34f6b5886371593fb8887dc17ba2f38a33d7bd279c9be4a4aa9508852575b384955a43e9625
7
- data.tar.gz: ce6457797b0d2a3acd392805967c7bb0de40e82398442de88d7ba5f1e6c087dd1b3eeea97dd37ec43f1f3d4cc2e76fc3b05598f823a7399886279af01c4dec3d
6
+ metadata.gz: f2fb4d1b8097e9c0af8eb9621701484a5701a12183fcabe13729f19f42f4648bfebf4d76830c90611d734ff5d9d93b5253f8a269b011cac0b5c38aa7e48bfffc
7
+ data.tar.gz: e0721ac24b36925bf40b63fbae758f7c649b36c501bcb0769219551500f586d2c3643922be3588aaf65e6393dd064bf382a64ade7f31cebba3d7a2a58b6c92bc
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,27 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ day: monday
8
+ time: "09:00"
9
+ timezone: "Etc/UTC"
10
+ groups:
11
+ github-actions:
12
+ patterns:
13
+ - "*"
14
+ open-pull-requests-limit: 10
15
+
16
+ - package-ecosystem: bundler
17
+ directory: "/"
18
+ schedule:
19
+ interval: weekly
20
+ day: monday
21
+ time: "09:00"
22
+ timezone: "Etc/UTC"
23
+ open-pull-requests-limit: 10
24
+ groups:
25
+ bundler-dependencies:
26
+ patterns:
27
+ - "*"
@@ -0,0 +1,13 @@
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
+ uses: yettoapp/actions/.github/workflows/automerge_dependabot.yml@main
13
+ secrets: inherit
@@ -0,0 +1,22 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Ruby
17
+ uses: yettoapp/actions/setup-languages@main
18
+ with:
19
+ ruby: true
20
+
21
+ - name: Run tests
22
+ run: bundle exec rake test
@@ -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@v4
16
+
17
+ - name: Set up Ruby
18
+ uses: yettoapp/actions/setup-languages@main
19
+ with:
20
+ ruby: true
21
+
22
+ - name: Rubocop
23
+ run: bundle exec rake rubocop
@@ -0,0 +1,19 @@
1
+ name: 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
+ ruby:
13
+ uses: yettoapp/actions/.github/workflows/ruby_gem_release.yml@main
14
+ secrets:
15
+ rubygems_api_key: ${{ secrets.RUBYGEMS_API_BOT_KEY }}
16
+ gh_token: ${{ secrets.PUBLIC_PUSH_TO_PROTECTED_BRANCH }}
17
+ with:
18
+ gem_name: html-pipeline
19
+ version_filepath: lib/html_pipeline/version.rb
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/**/*"
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.1
@@ -0,0 +1,8 @@
1
+ {
2
+ "[markdown]": {
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
4
+ },
5
+ "[ruby]": {
6
+ "editor.defaultFormatter": "Shopify.ruby-lsp"
7
+ }
8
+ }
data/CHANGELOG.md CHANGED
@@ -1,8 +1,88 @@
1
+ ## [v3.0.0.pre6] - 16-08-2023
2
+ null
1
3
  # Changelog
2
4
 
3
- ## [Unreleased](https://github.com/gjtorikian/html-pipeline/tree/HEAD)
5
+ ## [v3.0.0.pre5](https://github.com/gjtorikian/html-pipeline/tree/v3.0.0.pre5) (2023-06-05)
4
6
 
5
- [Full Changelog](https://github.com/gjtorikian/html-pipeline/compare/v2.14.2...HEAD)
7
+ [Full Changelog](https://github.com/gjtorikian/html-pipeline/compare/v3.0.0.pre4...v3.0.0.pre5)
8
+
9
+ ## [v3.0.0.pre4](https://github.com/gjtorikian/html-pipeline/tree/v3.0.0.pre4) (2023-06-05)
10
+
11
+ [Full Changelog](https://github.com/gjtorikian/html-pipeline/compare/v3.0.0.pre3...v3.0.0.pre4)
12
+
13
+ **Closed issues:**
14
+
15
+ - Suggestion: add more tags to the sanitization filter [\#378](https://github.com/gjtorikian/html-pipeline/issues/378)
16
+ - v3 gemoji, gemojione seem required - is there a way to not require at puma startup? [\#376](https://github.com/gjtorikian/html-pipeline/issues/376)
17
+ - v3: Question regarding requiring a ConvertFilter if there are NodeFilters [\#374](https://github.com/gjtorikian/html-pipeline/issues/374)
18
+ - alt Attribute for Emoji Images Should Use Unicode [\#272](https://github.com/gjtorikian/html-pipeline/issues/272)
19
+
20
+ **Merged pull requests:**
21
+
22
+ - Update gemoji requirement from ~\> 3.0 to ~\> 4.1 [\#382](https://github.com/gjtorikian/html-pipeline/pull/382) ([dependabot[bot]](https://github.com/apps/dependabot))
23
+ - Update rouge requirement from ~\> 3.1 to ~\> 4.1 [\#381](https://github.com/gjtorikian/html-pipeline/pull/381) ([dependabot[bot]](https://github.com/apps/dependabot))
24
+ - Add the AssetProxyFilter [\#379](https://github.com/gjtorikian/html-pipeline/pull/379) ([digitalmoksha](https://github.com/digitalmoksha))
25
+ - Update selma requirement from ~\> 0.0.1 to \>= 0.0.1, \< 0.2.0 [\#377](https://github.com/gjtorikian/html-pipeline/pull/377) ([dependabot[bot]](https://github.com/apps/dependabot))
26
+
27
+ ## [v3.0.0.pre3](https://github.com/gjtorikian/html-pipeline/tree/v3.0.0.pre3) (2023-02-15)
28
+
29
+ [Full Changelog](https://github.com/gjtorikian/html-pipeline/compare/v3.0.0.pre2...v3.0.0.pre3)
30
+
31
+ **Merged pull requests:**
32
+
33
+ - req convert\_filter if `text/node`filter present [\#375](https://github.com/gjtorikian/html-pipeline/pull/375) ([gjtorikian](https://github.com/gjtorikian))
34
+
35
+ ## [v3.0.0.pre2](https://github.com/gjtorikian/html-pipeline/tree/v3.0.0.pre2) (2023-01-26)
36
+
37
+ [Full Changelog](https://github.com/gjtorikian/html-pipeline/compare/v3.0.0.pre1...v3.0.0.pre2)
38
+
39
+ **Closed issues:**
40
+
41
+ - Indicate a version for activesupport that has support/receives security patches \(\>= 6?\) [\#367](https://github.com/gjtorikian/html-pipeline/issues/367)
42
+ - Add MathML elements to whitelist [\#336](https://github.com/gjtorikian/html-pipeline/issues/336)
43
+ - Feature request: add safe semantic HTML tags to default whitelist [\#312](https://github.com/gjtorikian/html-pipeline/issues/312)
44
+ - Allow float: left|right and clear: left|right|both in sanitation [\#302](https://github.com/gjtorikian/html-pipeline/issues/302)
45
+ - Open link in new tab option [\#266](https://github.com/gjtorikian/html-pipeline/issues/266)
46
+ - Consider allowing LINK and META elements in HTML [\#261](https://github.com/gjtorikian/html-pipeline/issues/261)
47
+ - Allow SVG elements in whitelist [\#251](https://github.com/gjtorikian/html-pipeline/issues/251)
48
+ - Allow RDFa 1.1 \(Lite\) attributes [\#249](https://github.com/gjtorikian/html-pipeline/issues/249)
49
+ - What’s the point of allowing the accept-charset attribute in the sanitization filter ? [\#218](https://github.com/gjtorikian/html-pipeline/issues/218)
50
+ - Use gemojione instead of gemoji [\#200](https://github.com/gjtorikian/html-pipeline/issues/200)
51
+ - Link schema not used with \<a\> markup : print them directly [\#194](https://github.com/gjtorikian/html-pipeline/issues/194)
52
+
53
+ **Merged pull requests:**
54
+
55
+ - Use emoji from commonmarker [\#373](https://github.com/gjtorikian/html-pipeline/pull/373) ([gjtorikian](https://github.com/gjtorikian))
56
+
57
+ ## [v3.0.0.pre1](https://github.com/gjtorikian/html-pipeline/tree/v3.0.0.pre1) (2022-12-30)
58
+
59
+ [Full Changelog](https://github.com/gjtorikian/html-pipeline/compare/v2.14.3...v3.0.0.pre1)
60
+
61
+ **Closed issues:**
62
+
63
+ - Allow `loading` attribute on images [\#359](https://github.com/gjtorikian/html-pipeline/issues/359)
64
+ - Allow picture tag in sanitation [\#352](https://github.com/gjtorikian/html-pipeline/issues/352)
65
+ - V3 ideas [\#350](https://github.com/gjtorikian/html-pipeline/issues/350)
66
+ - Invalid and missing HTML elements in the sanatizer [\#342](https://github.com/gjtorikian/html-pipeline/issues/342)
67
+ - Cellpadding & Cellspacing are not supported in HTML5. [\#303](https://github.com/gjtorikian/html-pipeline/issues/303)
68
+
69
+ **Merged pull requests:**
70
+
71
+ - Drop SyntaxHighlightFilter [\#372](https://github.com/gjtorikian/html-pipeline/pull/372) ([gjtorikian](https://github.com/gjtorikian))
72
+ - Close sanitization-related issues [\#371](https://github.com/gjtorikian/html-pipeline/pull/371) ([gjtorikian](https://github.com/gjtorikian))
73
+ - Update Selma signatures [\#370](https://github.com/gjtorikian/html-pipeline/pull/370) ([gjtorikian](https://github.com/gjtorikian))
74
+ - You shall pass [\#369](https://github.com/gjtorikian/html-pipeline/pull/369) ([gjtorikian](https://github.com/gjtorikian))
75
+ - Migrate from Nokogiri to Selma [\#368](https://github.com/gjtorikian/html-pipeline/pull/368) ([gjtorikian](https://github.com/gjtorikian))
76
+ - Split filters up [\#360](https://github.com/gjtorikian/html-pipeline/pull/360) ([gjtorikian](https://github.com/gjtorikian))
77
+ - Support multiple dependencies per filter [\#351](https://github.com/gjtorikian/html-pipeline/pull/351) ([gjtorikian](https://github.com/gjtorikian))
78
+ - Add Rubocop [\#349](https://github.com/gjtorikian/html-pipeline/pull/349) ([gjtorikian](https://github.com/gjtorikian))
79
+ - add truffleruby-head [\#348](https://github.com/gjtorikian/html-pipeline/pull/348) ([gogainda](https://github.com/gogainda))
80
+ - V3 Release [\#347](https://github.com/gjtorikian/html-pipeline/pull/347) ([gjtorikian](https://github.com/gjtorikian))
81
+ - Switch to GitHub Actions [\#346](https://github.com/gjtorikian/html-pipeline/pull/346) ([gjtorikian](https://github.com/gjtorikian))
82
+
83
+ ## [v2.14.3](https://github.com/gjtorikian/html-pipeline/tree/v2.14.3) (2022-10-14)
84
+
85
+ [Full Changelog](https://github.com/gjtorikian/html-pipeline/compare/v2.14.2...v2.14.3)
6
86
 
7
87
  **Closed issues:**
8
88
 
data/Gemfile CHANGED
@@ -1,26 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in html-pipeline.gemspec
6
6
  gemspec
7
7
 
8
+ gem "awesome_print"
9
+
10
+ gem "rubocop"
11
+ gem "rubocop-standard"
12
+
13
+ gem "github_changelog_generator", "~> 1.16"
14
+
15
+ gem "sorbet-runtime"
16
+
17
+ group :development, :test do
18
+ gem "amazing_print"
19
+ gem "debug"
20
+ end
21
+
8
22
  group :development do
9
- gem 'appraisal'
10
- gem 'bundler'
11
- gem 'rake'
23
+ gem "tapioca", require: false
24
+ gem "sorbet"
25
+ gem "bundler"
26
+ gem "rake"
12
27
  end
13
28
 
14
29
  group :test do
15
- gem 'commonmarker', '~> 0.16', require: false
16
- gem 'email_reply_parser', '~> 0.5', require: false
17
- gem 'gemoji', '~> 2.0', require: false
18
- gem 'minitest'
19
- gem 'RedCloth', '~> 4.2.9', require: false
20
- gem 'rinku', '~> 1.7', require: false
21
- gem 'sanitize', '~> 4.6', require: false
22
-
23
- gem 'escape_utils', '~> 1.0', require: false
24
- gem 'rouge', '~> 3.1', require: false
25
- gem 'minitest-focus', '~> 1.1'
30
+ gem "commonmarker", "~> 1.0.0.pre7", require: false
31
+ gem "gemoji", "~> 4.1", require: false
32
+ gem "gemojione", "~> 4.3", require: false
33
+
34
+ gem "minitest"
35
+
36
+ gem "minitest-bisect", "~> 1.6"
37
+
38
+ gem "nokogiri", "~> 1.13"
39
+
40
+ gem "minitest-focus", "~> 1.1"
41
+ gem "rouge", "~> 4.1", require: false
26
42
  end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 GitHub Inc. and Jerry Cheung
1
+ Copyright (c) 2023 Garen Torikian
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.