Class: ProsemirrorToHtml::RemoveEmptyParagraphsFormatter
- Inherits:
-
Object
- Object
- ProsemirrorToHtml::RemoveEmptyParagraphsFormatter
- Defined in:
- app/formatters/prosemirror_to_html/remove_empty_paragraphs_formatter.rb
Instance Method Summary collapse
-
#initialize(str) ⇒ RemoveEmptyParagraphsFormatter
constructor
A new instance of RemoveEmptyParagraphsFormatter.
- #to_s ⇒ Object
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_s ⇒ Object
7 8 9 |
# File 'app/formatters/prosemirror_to_html/remove_empty_paragraphs_formatter.rb', line 7 def to_s @str.gsub("<p></p>", "") end |