html-pipeline 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d505d0765630595363061d97d8f189a2712fc56b89371542a225d35421af386
4
- data.tar.gz: 9d10f5ad3c9d39fe65d6e3b22cd59070997e5774353806affde0a957a52f5812
3
+ metadata.gz: 6e66a69a9e35bc5703f036d091740bdc654f98cfaf38870761797699ed28199b
4
+ data.tar.gz: 7624bb08357fa9f358cb4947dbf5742916a3e620fa7db2d5296e9aba414e40f5
5
5
  SHA512:
6
- metadata.gz: 63b53387dfbb3bc7a9be29f0e6de9930daa773254dc885d0561b59a8d8ff50317ddabe62c364253b6da7142b3c4d169f72ce43f217ec50d18aee450513e88f13
7
- data.tar.gz: 948027919009faea3009e0e222491aeae865db4875602a40bbf5a458f8b712f633b6e66d386e95acadbb129bcba33f63afdddbc89b73758cc1b544855eb5b227
6
+ metadata.gz: 19083c1093cf8908028e8ea5233c97005a25072b5d77e9c28368570d477ff09cba5f6ae78e93e3633b766b9dcaeccc7bd746aacecbfdf480cd467306b230c1af
7
+ data.tar.gz: 74e3afc29616225353448945af5a3ee516a8cea67924e865edf89a65b92cf77d56196b2be50ccd6fce6d5d343ed4cc7181b3b6b7d2a146dbb281a1165ba66ef3
data/.gitignore CHANGED
@@ -17,4 +17,4 @@ test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
19
  exec/*
20
- vendor/gems
20
+ vendor/cache/
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [v3.2.2] - 09-08-2024
2
+ ## What's Changed
3
+ * Add support for @ prefix on MentionFilter base_url by @jeremysmithco in https://github.com/gjtorikian/html-pipeline/pull/411
4
+ * Bugfix: sanitization-only filters should still work by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/414
5
+
6
+ ## New Contributors
7
+ * @jeremysmithco made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/411
8
+
9
+ **Full Changelog**: https://github.com/gjtorikian/html-pipeline/compare/v3.2.1...v3.2.2
1
10
  # [v3.2.1] - 16-07-2024
2
11
  ## What's Changed
3
12
  * Update commonmarker requirement from ~> 1.0.0.pre7 to ~> 1.1.2 in the bundler-dependencies group by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/404
data/Gemfile CHANGED
@@ -25,7 +25,7 @@ group :development do
25
25
  end
26
26
 
27
27
  group :test do
28
- gem "commonmarker", "~> 1.1.2", require: false
28
+ gem "commonmarker", "~> 2.0.1", require: false
29
29
  gem "gemoji", "~> 4.1", require: false
30
30
  gem "gemojione", "~> 4.3", require: false
31
31
 
data/README.md CHANGED
@@ -343,34 +343,6 @@ service.subscribe "call_text_filters.html_pipeline" do |event, start, ending, tr
343
343
  end
344
344
  ```
345
345
 
346
- ## Third Party Extensions
347
-
348
- If you have an idea for a filter, propose it as
349
- [an issue](https://github.com/gjtorikian/html-pipeline/issues) first. This allows us to discuss
350
- whether the filter is a common enough use case to belong in this gem, or should be
351
- built as an external gem.
352
-
353
- Here are some extensions people have built:
354
-
355
- - [html-pipeline-asciidoc_filter](https://github.com/asciidoctor/html-pipeline-asciidoc_filter)
356
- - [jekyll-html-pipeline](https://github.com/gjtorikian/jekyll-html-pipeline)
357
- - [nanoc-html-pipeline](https://github.com/burnto/nanoc-html-pipeline)
358
- - [html-pipeline-bitly](https://github.com/dewski/html-pipeline-bitly)
359
- - [html-pipeline-cite](https://github.com/lifted-studios/html-pipeline-cite)
360
- - [tilt-html-pipeline](https://github.com/bradgessler/tilt-html-pipeline)
361
- - [html-pipeline-wiki-link'](https://github.com/lifted-studios/html-pipeline-wiki-link) - WikiMedia-style wiki links
362
- - [task_list](https://github.com/github/task_list) - GitHub flavor Markdown Task List
363
- - [html-pipeline-nico_link](https://github.com/rutan/html-pipeline-nico_link) - An HTMLPipeline filter for [niconico](http://www.nicovideo.jp) description links
364
- - [html-pipeline-gitlab](https://gitlab.com/gitlab-org/html-pipeline-gitlab) - This gem implements various filters for html-pipeline used by GitLab
365
- - [html-pipeline-youtube](https://github.com/st0012/html-pipeline-youtube) - An HTMLPipeline filter for YouTube links
366
- - [html-pipeline-flickr](https://github.com/st0012/html-pipeline-flickr) - An HTMLPipeline filter for Flickr links
367
- - [html-pipeline-vimeo](https://github.com/dlackty/html-pipeline-vimeo) - An HTMLPipeline filter for Vimeo links
368
- - [html-pipeline-hashtag](https://github.com/mr-dxdy/html-pipeline-hashtag) - An HTMLPipeline filter for hashtags
369
- - [html-pipeline-linkify_github](https://github.com/jollygoodcode/html-pipeline-linkify_github) - An HTMLPipeline filter to autolink GitHub urls
370
- - [html-pipeline-redcarpet_filter](https://github.com/bmikol/html-pipeline-redcarpet_filter) - Render Markdown source text into Markdown HTML using Redcarpet
371
- - [html-pipeline-typogruby_filter](https://github.com/bmikol/html-pipeline-typogruby_filter) - Add Typogruby text filters to your HTMLPipeline
372
- - [korgi](https://github.com/jodeci/korgi) - HTMLPipeline filters for links to Rails resources
373
-
374
346
  ## FAQ
375
347
 
376
348
  ### 1. Why doesn't my pipeline work when there's no root element in the document?
@@ -115,7 +115,8 @@ class HTMLPipeline
115
115
  result[:mentioned_usernames] |= [login]
116
116
 
117
117
  url = base_url.dup
118
- url << "/" unless %r{[/~]\z}.match?(url)
118
+ excluded_prefixes = %r{[/(?:~|@]\z}
119
+ url << "/" unless excluded_prefixes.match?(url)
119
120
 
120
121
  "<a href=\"#{url << login}\" class=\"user-mention\">" \
121
122
  "@#{login}" \
@@ -94,7 +94,8 @@ class HTMLPipeline
94
94
  result[:mentioned_teams] |= [team]
95
95
 
96
96
  url = base_url.dup
97
- url << "/" unless %r{[/~]\z}.match?(url)
97
+ excluded_prefixes = %r{[/(?:~|@]\z}
98
+ url << "/" unless excluded_prefixes.match?(url)
98
99
 
99
100
  "<a href=\"#{url << org}/#{team}\" class=\"team-mention\">" \
100
101
  "@#{org}/#{team}" \
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class HTMLPipeline
4
- VERSION = "3.2.1"
4
+ VERSION = "3.2.2"
5
5
  end
data/lib/html_pipeline.rb CHANGED
@@ -183,8 +183,8 @@ class HTMLPipeline
183
183
 
184
184
  if @node_filters.empty?
185
185
  instrument("sanitization.html_pipeline", payload) do
186
- result[:output] = Selma::Rewriter.new(sanitizer: @sanitization_config, handlers: @node_filters, options: rewriter_options).rewrite(html)
187
- end unless @convert_filter.nil? # no html, so no sanitization
186
+ result[:output] = Selma::Rewriter.new(sanitizer: @sanitization_config, options: rewriter_options).rewrite(html)
187
+ end
188
188
  else
189
189
  instrument("call_node_filters.html_pipeline", payload) do
190
190
  @node_filters.each { |filter| filter.context = (filter.context || {}).merge(context) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-31 00:00:00.000000000 Z
11
+ date: 2024-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selma
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: 3.3.22
113
113
  requirements: []
114
114
  rubygems_version: 3.4.6
115
- signing_key:
115
+ signing_key:
116
116
  specification_version: 4
117
117
  summary: Helpers for processing content through a chain of filters
118
118
  test_files: []