Sha256: f3fdb145803494f957a135903df9909f867f34b98f5d1a297b2377853ab30346

Contents?: true

Size: 855 Bytes

Versions: 3

Compression:

Stored size: 855 Bytes

Contents

# frozen_string_literal: true

RSpec.describe TTY::Markdown, 'paragraph' do
  it "converts multiline paragraphs" do
    markdown =<<-TEXT
This is a first paragraph
that spans two lines.

And this is a next one.
    TEXT
    parsed = TTY::Markdown.parse(markdown)
    expect(parsed).to eq([
      "This is a first paragraph",
      "that spans two lines.",
      "",
      "And this is a next one.\n"
    ].join("\n"))
  end

  it "converts multiline pragraphs within header section" do

    markdown =<<-TEXT
### header
This is a first paragraph
that spans two lines.

And this is a next one.
    TEXT
    parsed = TTY::Markdown.parse(markdown)
    expect(parsed).to eq([
      "    \e[36;1mheader\e[0m",
      "    This is a first paragraph",
      "    that spans two lines.",
      "",
      "    And this is a next one.\n"
    ].join("\n"))
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tty-markdown-0.6.0 spec/unit/parse/paragraph_spec.rb
tty-markdown-0.5.1 spec/unit/parse/paragraph_spec.rb
tty-markdown-0.5.0 spec/unit/parse/paragraph_spec.rb