~michalr/blog2gmi

d07c0aef9ea557af18270bfefe68cb5142e17d59 — MichaƂ Rudowicz 3 years ago 69855be
Strong and emphasis support
2 files changed, 20 insertions(+), 2 deletions(-)

M spec/gmi_renderer_spec.cr
M src/gmi_renderer.cr
M spec/gmi_renderer_spec.cr => spec/gmi_renderer_spec.cr +18 -0
@@ 107,6 107,24 @@ It does print hello world."
    actual.should eq(expected)
  end

  it "should render emphasis like markdown because I have no better idea" do
    input = "Hello *world* and _others_!"
    expected = "Hello *world* and *others*!"

    actual = render_to_gmi(input)

    actual.should eq(expected)
  end

  it "should render strong like markdown because I have no better idea" do
    input = "Hello **world** and __others__!"
    expected = "Hello **world** and **others**!"

    actual = render_to_gmi(input)

    actual.should eq(expected)
  end

  it "should render unordered lists" do
    input = "* First element
* Second element

M src/gmi_renderer.cr => src/gmi_renderer.cr +2 -2
@@ 68,7 68,7 @@ class GmiRenderer < Markd::Renderer
  end

  def emphasis(node, entering)
    raise "Not implemented"
    @output_io << "*"
  end

  def soft_break(node, entering)


@@ 80,7 80,7 @@ class GmiRenderer < Markd::Renderer
  end

  def strong(node, entering)
    raise "Not implemented"
    @output_io << "**"
  end

  def link(node, entering)