# frozen_string_literal: true require 'test_helper' class TestKramdownList < Minitest::Test # NOTE: kramdown automatically injects `id` attribute def test_kramdown_heading text = <<~MARKDOWN # h1 ## h2 MARKDOWN expected = <<~HTML

h1

h2

HTML actual = Kramdown::Document.new(text).to_html assert_equal(expected, actual) end def test_japanese_heading text = <<~MARKDOWN # 日本語見出し1 ## 日本語見出し2 MARKDOWN expected = <<~HTML

日本語見出し1

日本語見出し2

HTML actual = Kramdown::Document.new(text).to_html assert_equal(expected, actual) end def test_kramdown_list_l1_l5 text = <<~MARKDOWN * level-1 * level-2 * level-3 * level-4 * level-5 MARKDOWN expected = <<~HTML HTML actual = Kramdown::Document.new(text).to_html assert_equal(expected, actual) end def test_kramdown_list_l1_l3_l2_l4 text = <<~MARKDOWN * level-1 * level-3 * level-2 * level-4 * level-5 MARKDOWN expected = <<~HTML HTML actual = Kramdown::Document.new(text).to_html assert_equal(expected, actual) end def test_kramdown_list_l4_l1 text = <<~MARKDOWN * level-4 * level-3 * level-2 * level-1 MARKDOWN expected = <<~HTML
  * level-4
      * level-3   * level-2 * level-1
      
HTML actual = Kramdown::Document.new(text).to_html assert_equal(expected, actual) end def test_kramdown_list_l1_l4_l1 text = <<~MARKDOWN * level-1 * level-4 * level-3 * level-2 * level-1 MARKDOWN expected = <<~HTML HTML actual = Kramdown::Document.new(text).to_html assert_equal(expected, actual) end def test_kramdown_list_l1_l3_l1 text = <<~MARKDOWN * level-1 * level-3 * level-2 * level-1 MARKDOWN expected = <<~HTML HTML actual = Kramdown::Document.new(text).to_html assert_equal(expected, actual) end end