Skip to content

Commit 93451ee

Browse files
committed
Fixed paragraphs disappearing when end-of-line style doc comments are used. Fixes #38.
1 parent 15bba35 commit 93451ee

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

demo/parsing.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ int b;
3939

4040
///
4141
/// Documented with `///` style preceding comment that wraps across multiple
42-
/// lines.
42+
/// lines and has multiple paragraphs.
43+
///
44+
///This is the second paragraph.
4345
///
4446
/// @ingroup parsing
4547
///
48+
/// This is the third paragraph.
49+
///
4650
int c;
4751

4852
int d; ///< Documented after entity with `///` comment @ingroup parsing

src/Parser.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,12 @@ void Parser::translate(const std::string_view& comment, Entity& entity) {
468468
token = tokenizer.next();
469469
}
470470
if (file) {
471+
/* discard */
471472
entity.docs.clear();
473+
} else {
474+
/* always add a new line, as multiple doc comments may appear before an
475+
* entity (e.g. multiple end-of-line style comments) and these should be
476+
* separated with new lines */
477+
entity.docs.append("\n");
472478
}
473479
}

0 commit comments

Comments
 (0)