diff options
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r-- | src/markdown.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index e395fd9..7f6dc9b 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2068,13 +2068,17 @@ void Markdown::writeOneLineHeaderOrRuler(const char *data,int size) m_out.addStr("</"+hTag+">\n"); } } - else // nothing interesting -> just output the line + else if (size>0) // nothing interesting -> just output the line { - m_out.addStr(data,size); + int tmpSize = size; + if (data[size-1] == '\n') tmpSize--; + m_out.addStr(data,tmpSize); + if (hasLineBreak(data,size)) { - m_out.addStr("<br>\n"); + m_out.addStr("<br>"); } + if (tmpSize != size) m_out.addChar('\n'); } } |