summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-10-20 14:26:53 (GMT)
committerGitHub <noreply@github.com>2020-10-20 14:26:53 (GMT)
commit33341fe5fb8048411acea0276219a69be06fe02d (patch)
tree377092b5cb6018ea33019b3e0f3f34563b15c5ac /src/markdown.cpp
parent8eb8e0b77cc50b02a7cb17abb1e4c9b7c1b0d60a (diff)
parentb035a11197f69770db5c7ebfb50cb42afc22468d (diff)
downloadDoxygen-33341fe5fb8048411acea0276219a69be06fe02d.zip
Doxygen-33341fe5fb8048411acea0276219a69be06fe02d.tar.gz
Doxygen-33341fe5fb8048411acea0276219a69be06fe02d.tar.bz2
Merge pull request #8114 from albert-github/feature/bug_cnt_md_extra_line
Miscounting in case of markdown wanted newline due to spaces at end of line
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp10
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');
}
}