Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagab committed Sep 25, 2024
1 parent 92f6f1a commit b31d114
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/phlex/sgml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def context
end

def plain(content)
unless __text__(content)
unless __text__(content)
raise Phlex::ArgumentError.new("You've passed an object to plain that is not handled by format_object. See https://rubydoc.info/gems/phlex/Phlex/SGML#format_object-instance_method for more information")
end

Expand Down Expand Up @@ -271,7 +271,7 @@ def yield_content

original_length = buffer.bytesize
content = yield(self)
__implicit_output__(content) if original_length == buffer.bytesize
__implicit_output__(content) if original_length == buffer.bytesize

nil
end
Expand All @@ -283,7 +283,7 @@ def __yield_content_with_no_args__

original_length = buffer.bytesize
content = yield
__implicit_output__(content) if original_length == buffer.bytesize
__implicit_output__(content) if original_length == buffer.bytesize

nil
end
Expand All @@ -295,18 +295,18 @@ def __yield_content_with_args__(*)

original_length = buffer.bytesize
content = yield(*)
__implicit_output__(content) if original_length == buffer.bytesize
__implicit_output__(content) if original_length == buffer.bytesize

nil
end

def __implicit_output__(content)
def __implicit_output__(content)
context = @_context
return true if context.fragments && !context.in_target_fragment

case content
when Phlex::SGML::SafeObject
context.buffer << content.to_s
context.buffer << content.to_s
when String
context.buffer << Phlex::Escape.html_escape(content)
when Symbol
Expand All @@ -325,9 +325,9 @@ def __implicit_output__(content)
end

# same as __implicit_output__ but escapes even `safe` objects
def __text__(content)
context = @_context
return true if context.fragments && !context.in_target_fragment
def __text__(content)
context = @_context
return true if context.fragments && !context.in_target_fragment

case content
when String
Expand Down

0 comments on commit b31d114

Please sign in to comment.