1
0
scáthán de https://github.com/quitesimpleorg/qsmaddy.git sioncronaithe 2026-01-23 02:57:55 +01:00

breaklineparser: First version

Some markdown provides such as GitHub, uses \r\n to create <br>

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Tá an tiomantas seo le fáil i:
Patrick José Pereira
2019-12-16 10:57:08 -03:00
tuismitheoir 0fb6de703d
tiomantas 77782635d4
D'athraigh 3 comhad le 92 breiseanna agus 1 scriosta

Féach ar an gComhad

@@ -0,0 +1,35 @@
/*
* This project is licensed under the MIT license. For more information see the
* LICENSE file.
*/
#include <memory>
#include "gmock/gmock.h"
#include "maddy/breaklineparser.h"
// -----------------------------------------------------------------------------
TEST(MADDY_BREAKLINEPARSER, ItReplacesMarkdownWithBreakLineHTML)
{
std::string text =
"Test the text\r\n"
"test text to check\r\n"
"check testing to text.\r"
"Check test to test text\r"
"This is a test\r\n"
"No more test to check";
std::string expected =
"Test the text<br>"
"test text to check<br>"
"check testing to text.<br>"
"Check test to test text<br>"
"This is a test<br>"
"No more test to check";
auto breakLineParser = std::make_shared<maddy::BreakLineParser>();
breakLineParser->Parse(text);
ASSERT_EQ(text, expected);
}