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)