Class: ProsemirrorToHtml::RemoveEmptyParagraphsFormatter

Inherits:
Object
  • Object
show all
Defined in:
app/formatters/prosemirror_to_html/remove_empty_paragraphs_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ RemoveEmptyParagraphsFormatter

Returns a new instance of RemoveEmptyParagraphsFormatter.



3
4
5
# File 'app/formatters/prosemirror_to_html/remove_empty_paragraphs_formatter.rb', line 3

def initialize(str)
  @str = str
end

Instance Method Details

#to_sObject



7
8
9
# File 'app/formatters/prosemirror_to_html/remove_empty_paragraphs_formatter.rb', line 7

def to_s
  @str.gsub("<p></p>", "")
end