1
0
espelhamento de https://github.com/quitesimpleorg/qsmaddy.git sincronizado 2025-10-09 17:36:31 +02:00

orderedlistparser: Add parsing support for fully numeric markdown lists

Esse commit está contido em:
Drew Mettlach
2020-10-03 17:22:21 -05:00
commit cde0137e90
4 arquivos alterados com 47 adições e 4 exclusões

Ver arquivo

@@ -96,3 +96,26 @@ TEST_F(MADDY_ORDEREDLISTPARSER, ItReplacesMarkdownWithAnHierachicalHtmlList)
ASSERT_EQ(expected, outputString);
}
TEST_F(MADDY_ORDEREDLISTPARSER, ItReplacesNumberedMarkdownListWithAnHtmlOrderedList)
{
std::vector<std::string> markdown = {
"1. a"
, "94. b"
, "103. c"
, ""
};
std::string expected = "<ol><li>a</li><li>b</li><li>c</li></ol>";
for (std::string md : markdown)
{
olParser->AddLine(md);
}
ASSERT_TRUE(olParser->IsFinished());
std::stringstream& output(olParser->GetResult());
const std::string& outputString = output.str();
ASSERT_EQ(expected, outputString);
}