Skip to content

Commit

Permalink
Add Rails 7.1 support.
Browse files Browse the repository at this point in the history
Handle when `string` is a `ActionView::OutputBuffer` by converting it to a `String` first.

Pulled from zombocom#71.
  • Loading branch information
joshuapinter committed Jan 22, 2024
1 parent 965a6d3 commit a73ed22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/maildown/markdown_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ module MarkdownEngine
@maildown_markdown_engine_text_block = nil

def self.to_html(string)
string = string.to_s if string.is_a?(ActionView::OutputBuffer) # Needed for Rails 7.1 support. See https://github.com/zombocom/maildown/pull/71
html_block.call(string)
end

def self.to_text(string)
string = string.to_s if string.is_a?(ActionView::OutputBuffer) # Needed for Rails 7.1 support. See https://github.com/zombocom/maildown/pull/71
text_block.call(string)
end

Expand Down

0 comments on commit a73ed22

Please sign in to comment.