diff --git a/LennahSSG/LennahSSG.cpp b/LennahSSG/LennahSSG.cpp index c877b4f..c30ce5b 100644 --- a/LennahSSG/LennahSSG.cpp +++ b/LennahSSG/LennahSSG.cpp @@ -13,6 +13,7 @@ void version_message(); void readTxt(string path); string italicize(string itLine); string boldify(string boldLine); +string trim(string line); string inlineCode(string line); int fileType = 0; @@ -178,6 +179,10 @@ static void readTxt(string path) { if (line.find("`") != string::npos) { line = inlineCode(line); } + + if (trim(line) == "---") { + line = "
"; + } } //format

tags @@ -237,6 +242,14 @@ string boldify(string boldLine) { } return boldLine; } +string trim(string line) +{ + const char* WhiteSpace = " \t\v\r\n"; + size_t start = line.find_first_not_of(WhiteSpace); + size_t end = line.find_last_not_of(WhiteSpace); + return start == end ? string() : line.substr(start, end - start + 1); +} +} string inlineCode(string line) { while (line.find("`") != string::npos) { if (line.find("`") != string::npos && line.find("`") != line.find_last_of("`")) {