Skip to content

Update html-pipeline requirement from ~> 2.0 to >= 2, < 4 #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/qiita/markdown.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "cgi"
require "html/pipeline"
require "html_pipeline"
require "linguist"
require "mem"
require "nokogiri"
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/base_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def call(input, context = {})
end

# @note Modify filters if you want.
# @return [Array<HTML::Pipeline::Filter>]
# @return [Array<HTMLPipelineFilter>]
def filters
@filters ||= self.class.default_filters
end
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/checkbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Filters
# * [ ] Bar
# * [ ] Baz
#
class Checkbox < HTML::Pipeline::Filter
class Checkbox < ::HTMLPipelineFilter
def call
doc.search("li").each do |li|
list = List.new(li)
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/code_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Filters
# 3. Adds detected code data into `result[:codes]`.
#
# You can pass language aliases table via context[:language_aliases].
class CodeBlock < HTML::Pipeline::Filter
class CodeBlock < ::HTMLPipelineFilter
def call
result[:codes] ||= []
doc.search("pre").each do |pre|
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/custom_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Qiita
module Markdown
module Filters
class CustomBlock < HTML::Pipeline::Filter
class CustomBlock < ::HTMLPipelineFilter
ALLOWED_TYPES = %w[note].freeze

def call
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/external_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Qiita
module Markdown
module Filters
class ExternalLink < HTML::Pipeline::Filter
class ExternalLink < ::HTMLPipelineFilter
def call
doc.search("a").each do |anchor|
next unless anchor["href"]
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/final_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Filters
# generated by other filters.
#
# @see Qiita::Markdown::Filters::UserInputSanitizerr
class FinalSanitizer < ::HTML::Pipeline::Filter
class FinalSanitizer < ::HTMLPipelineFilter
RULE = {
attributes: {
"a" => %w[
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/footnote.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Qiita
module Markdown
module Filters
class Footnote < HTML::Pipeline::Filter
class Footnote < ::HTMLPipelineFilter
def call
doc.search("sup > a").each do |a|
footnote = find_footnote(a)
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/group_mention.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Qiita
module Markdown
module Filters
class GroupMention < HTML::Pipeline::Filter
class GroupMention < ::HTMLPipelineFilter
# @note Override
def call
if context[:group_mention_url_generator]
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/heading_anchor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Qiita
module Markdown
module Filters
class HeadingAnchor < ::HTML::Pipeline::Filter
class HeadingAnchor < ::HTMLPipelineFilter
def call
doc.search("h1, h2, h3, h4, h5, h6").each do |heading|
heading["id"] = suffixed_id(heading)
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/html_toc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Qiita
module Markdown
module Filters
class HtmlToc < ::HTML::Pipeline::Filter
class HtmlToc < ::HTMLPipelineFilter
# @return [Nokogiri::HTML::DocumentFragment]
def call
headings = doc.search("h1, h2, h3, h4, h5, h6")
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/image_link.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Qiita
module Markdown
module Filters
class ImageLink < HTML::Pipeline::Filter
class ImageLink < ::HTMLPipelineFilter
def call
doc.search("img").each do |img|
next if img.ancestors.any? { |ancestor| ancestor.name == "a" }
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/inline_code_color.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Qiita
module Markdown
module Filters
class InlineCodeColor < HTML::Pipeline::Filter
class InlineCodeColor < ::HTMLPipelineFilter
DEFAULT_CLASS_NAME = "inline-code-color".freeze

REGEXPS = Regexp.union(
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/simplify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Filters
# want to clean up only some elements, and they would be run in the
# `FinalSanitizer` filter later.
# https://github.com/rgrove/sanitize/blob/v3.1.2/lib/sanitize.rb#L77-L100
class Simplify < HTML::Pipeline::Filter
class Simplify < ::HTMLPipelineFilter
SIMPLE_ELEMENTS = %w[a b code em i ins q s samp span strike strong sub sup var]

COMPLEX_CONTENT_ELEMENTS = %w[table]
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/syntax_highlight.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Qiita
module Markdown
module Filters
class SyntaxHighlight < HTML::Pipeline::Filter
class SyntaxHighlight < ::HTMLPipelineFilter
DEFAULT_LANGUAGE = "text"
DEFAULT_TIMEOUT = Float::INFINITY
DEFAULT_OPTION = "html_legacy"
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/toc.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Qiita
module Markdown
module Filters
class Toc < HTML::Pipeline::Filter
class Toc < ::HTMLPipelineFilter
def call
doc.css("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each do |node|
Heading.new(node).decorate
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/truncate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Filters
#
# @example
# Truncate.new(doc, truncate: { length: 50, omission: '... (continued)' })
class Truncate < HTML::Pipeline::Filter
class Truncate < ::HTMLPipelineFilter
DEFAULT_OPTIONS = {
length: 100,
omission: "…".freeze,
Expand Down
2 changes: 1 addition & 1 deletion lib/qiita/markdown/filters/user_input_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Qiita
module Markdown
module Filters
# Sanitizes user input if :strict context is given.
class UserInputSanitizer < ::HTML::Pipeline::Filter
class UserInputSanitizer < ::HTMLPipelineFilter
RULE = {
elements: %w[
a b blockquote br caption code dd del details div dl dt em font h1 h2 h3 h4 h5 h6
Expand Down
2 changes: 1 addition & 1 deletion qiita-markdown.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "addressable"
spec.add_dependency "gemoji"
spec.add_dependency "github-linguist", "~> 7.0"
spec.add_dependency "html-pipeline", "~> 2.0"
spec.add_dependency "html-pipeline", ">= 2", "< 4"
spec.add_dependency "mem"
spec.add_dependency "qiita_marker", "~> 0.23.9"
spec.add_dependency "rouge", "~> 4.2"
Expand Down
Loading