Skip to content

Commit

Permalink
Merge pull request #73 from joeldrapper/override-plain
Browse files Browse the repository at this point in the history
Override `plain` so it doesn't HTML-escape `ActiveSupport::SafeBuffer`
  • Loading branch information
joeldrapper authored Feb 27, 2023
2 parents d1d1458 + f64eff1 commit 3afd706
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/phlex/rails/sgml/overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ def capture
super&.html_safe
end

def plain(content)
case content
when ActiveSupport::SafeBuffer
@_target << content
else
super
end
end

# Trick ViewComponent into thinking we're a ViewComponent to fix rendering output
def set_original_view_context(view_context)
end
Expand Down

0 comments on commit 3afd706

Please sign in to comment.