Sha256: cca5bddda5585a76a8d160ecba9dc43e2f4f4e7ff39958fe1572b3feefba6234

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 Bytes

Contents

require 'test_helper'

class TestLinebreaks < Minitest::Test
  def test_hardbreak_no_spaces
    doc = CommonMarker.render_doc("foo\nbaz")
    assert_equal "<p>foo\nbaz</p>\n", doc.to_html

    doc = CommonMarker.render_doc("foo\nbaz", :hardbreaks)
    assert_equal "<p>foo<br />\nbaz</p>\n", doc.to_html(:hardbreaks)
  end

  def test_hardbreak_with_spaces
    doc = CommonMarker.render_doc("foo  \nbaz")
    assert_equal "<p>foo<br />\nbaz</p>\n", doc.to_html

    doc = CommonMarker.render_doc("foo  \nbaz", :hardbreaks)
    assert_equal "<p>foo<br />\nbaz</p>\n", doc.to_html(:hardbreaks)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
commonmarker-0.5.0 test/test_linebreaks.rb
commonmarker-0.4.1 test/test_linebreaks.rb
commonmarker-0.4.0 test/test_linebreaks.rb
commonmarker-0.3.0 test/test_linebreaks.rb
commonmarker-0.2.1 test/test_linebreaks.rb
commonmarker-0.2.0 test/test_linebreaks.rb