Commit 19ac5e05 authored by aggsol's avatar aggsol 🙉

Allow page break in sections

parent fe91c888
Pipeline #26010362 (#4) passed with stage
in 1 minute and 38 seconds
......@@ -225,7 +225,11 @@ void Parser::parseLine(const std::string& line, std::map<int, Section>& sections
break;
case State::ReferenceSection:
if(c == '>')
if(c == '<')
{
state = State::PageBreak;
}
else if(c == '>')
{
if(peek != '>')
{
......@@ -254,6 +258,11 @@ void Parser::parseLine(const std::string& line, std::map<int, Section>& sections
}
break;
case State::PageBreak:
// NOP?
state = State::Done;
break;
case State::Style:
if(c == '\n' || c == ' ' || c == '\t' || c == '\r')
{
......
......@@ -62,7 +62,8 @@ private:
Style = 4,
ReferenceStart = 5,
ReferenceSection = 6,
Anchor = 8
Anchor = 8,
PageBreak = 9
};
std::ifstream m_file;
......
......@@ -45,6 +45,7 @@ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
Blättere nach <<section-5>>
[[section-5]]
<<<
=== 5
[.add-item-key]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment