Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ maddy uses [semver versioning](https://semver.org/).

## Upcoming

* ![**FIXED**](https://img.shields.io/badge/-FIXED-%23090) One-liner quote is not producing any output.
* ...

## version 1.6.0 2025-07-26
Expand Down
17 changes: 12 additions & 5 deletions include/maddy/quoteparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class QuoteParser : public BlockParser
this->childParser = nullptr;
}

this->finishQuote(finish);

return;
}

Expand All @@ -107,11 +109,7 @@ class QuoteParser : public BlockParser
this->parseLine(line);
}

if (finish)
{
this->result << "</blockquote>";
this->isFinished = true;
}
this->finishQuote(finish);

this->result << line;
}
Expand Down Expand Up @@ -145,6 +143,15 @@ class QuoteParser : public BlockParser
private:
bool isStarted;
bool isFinished;

void finishQuote(bool finish)
{
if (finish)
{
this->result << "</blockquote>";
this->isFinished = true;
}
}
}; // class QuoteParser

// -----------------------------------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions tests/maddy/test_maddy_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ TEST(MADDY_PARSER, ItShouldParse)
ASSERT_EQ(testHtml, output);
}

TEST(MADDY_PARSER, ItShouldParseOneLiner)
{
auto parser = std::make_shared<maddy::Parser>();
std::stringstream markdown("> This is a **test**");

const std::string output = parser->Parse(markdown);

ASSERT_EQ(
"<blockquote><p>This is a <strong>test</strong> </p></blockquote>", output
);
}

TEST(MADDY_PARSER, ItShouldParseWithBitwiseConfig)
{
auto config = std::make_shared<maddy::ParserConfig>();
Expand Down