Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from apiaryio/pksunkara/sublist
Browse files Browse the repository at this point in the history
chore: Update sundown
  • Loading branch information
klokane authored Sep 7, 2016
2 parents bb58b62 + ee8420f commit a6f4af1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/sundown
Submodule sundown updated 1 files
+4 −6 src/markdown.c
27 changes: 27 additions & 0 deletions test/test-MarkdownParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,30 @@ TEST_CASE("Multi-paragraph list item source map", "[parser][sourcemap]")
REQUIRE(p2.sourceMap[0].length == 28);
}

TEST_CASE("Sublist should have more indentation than the list item", "[parser]")
{
MarkdownParser parser;
MarkdownNode ast;

ByteBuffer src = \
" + 1\n"\
"+ 2\n";

parser.parse(src, ast);

REQUIRE(ast.type == RootMarkdownNodeType);
REQUIRE(ast.text.empty());
REQUIRE(ast.children().size() == 2);

MarkdownNode& list = ast.children().front();
REQUIRE(list.type == ListItemMarkdownNodeType);
REQUIRE(list.children().size() == 1);
REQUIRE(list.children().front().type == ParagraphMarkdownNodeType);
REQUIRE(list.children().front().text == "1\n");

list = ast.children().back();
REQUIRE(list.type == ListItemMarkdownNodeType);
REQUIRE(list.children().size() == 1);
REQUIRE(list.children().front().type == ParagraphMarkdownNodeType);
REQUIRE(list.children().front().text == "2\n");
}

0 comments on commit a6f4af1

Please sign in to comment.