Module: Jekyll::TruncMarkdown
- Defined in:
- jekyll/_plugins/trunc-markdown.rb
Instance Method Summary collapse
-
#trunc_markdownify(input) ⇒ Object
Convert a Markdown string into HTML output.
Instance Method Details
#trunc_markdownify(input) ⇒ Object
Convert a Markdown string into HTML output. but truncates the final new line convert all line breaks to
input - The Markdown String to convert.
Returns the HTML formatted String.
10 11 12 13 14 15 16 17 18 |
# File 'jekyll/_plugins/trunc-markdown.rb', line 10 def trunc_markdownify(input) site = @context.registers[:site] converter = site.find_converter_instance(Jekyll::Converters::Markdown) html_text = converter.convert(input).chomp if html_text.include? "\n" html_text = html_text.gsub! "\n", '<br>' end html_text end |