Class: Sourcerer::MarkDownGrade::HtmlComment

Inherits:
ReverseMarkdown::Converters::Base
  • Object
show all
Defined in:
lib/sourcerer/mark_down_grade.rb

Overview

HTML Comment converter: preserve comments and ensure a trailing newline.

Instance Method Summary collapse

Instance Method Details

#convert(node, _state = {}) ⇒ Object



559
560
561
562
# File 'lib/sourcerer/mark_down_grade.rb', line 559

def convert node, _state={}
  out = node.to_html
  out.end_with?("\n") ? out : "#{out}\n"
end