summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-10-18 14:28:43 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-10-18 14:28:43 (GMT)
commitf3baca79549205c19cde6712a93982f971b58da5 (patch)
tree54da54f8bf55d6f84c0623e14c166c723883d645 /src
parentccca51f80ce6a4c380545800f6ea8b5ae27c8724 (diff)
downloadDoxygen-f3baca79549205c19cde6712a93982f971b58da5.zip
Doxygen-f3baca79549205c19cde6712a93982f971b58da5.tar.gz
Doxygen-f3baca79549205c19cde6712a93982f971b58da5.tar.bz2
When we have some simple markdown files like with extra spaces (after `\aa2`, `\bb2` and `\ccs2` to give in markdown a newline):
``` First test: 2 extra spaces after first line with error no extra empty lines \aa2 \aa3 ``` and ``` First test: 2 extra spaces after first line with error one extra empty line \bb2 \bb4 ``` and ``` First test: 2 extra spaces after first line with error two extra empty lines \cc2 \cc5 ``` we get warnings like: ``` .../aa.md:2: warning: Found unknown command '\aa2' .../aa.md:4: warning: Found unknown command '\aa3' .../bb.md:2: warning: Found unknown command '\bb2' .../bb.md:5: warning: Found unknown command '\bb4' .../cc.md:2: warning: Found unknown command '\cc2' .../cc.md:6: warning: Found unknown command '\cc5' ``` whilst this should be: ``` .../aa.md:2: warning: Found unknown command '\aa2' .../aa.md:3: warning: Found unknown command '\aa3' .../bb.md:2: warning: Found unknown command '\bb2' .../bb.md:4: warning: Found unknown command '\bb4' .../cc.md:2: warning: Found unknown command '\cc2' .../cc.md:5: warning: Found unknown command '\cc5' ``` This has been corrected by placing the `<br>` straight after the extra spaces and by not adding an extra newline.
Diffstat (limited to 'src')
-rw-r--r--src/markdown.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 930efd6..8da908c 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -2070,11 +2070,15 @@ void Markdown::writeOneLineHeaderOrRuler(const char *data,int size)
}
else // 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');
}
}