@@ -1233,24 +1233,26 @@ visitBlockCommandComment(
12331233 doc::Paragraph paragraph;
12341234 auto scope = enterScope (paragraph);
12351235 visitChildren (C->getParagraph ());
1236- if (! paragraph. children . empty () )
1236+ if (C-> getNumArgs () > 0 )
12371237 {
1238- if (C->getNumArgs () > 0 )
1239- {
1240- jd_.emplace_back (doc::Heading (C->getArgText (0 ).str ()));
1241- }
1242- else
1238+ jd_.emplace_back (doc::Heading (C->getArgText (0 ).str ()));
1239+ }
1240+ if (!paragraph.children .empty ())
1241+ {
1242+ // the first TextComment is the heading text
1243+ if (C->getNumArgs () == 0 )
12431244 {
1244- // the first TextComment is the heading text
12451245 doc::String text (std::move (
12461246 paragraph.children .front ()->string ));
12471247
12481248 // VFALCO Unfortunately clang puts at least
12491249 // one space in front of the text, which seems
12501250 // incorrect.
1251- auto const s = trim (text);
1252- if (s.size () != text.size ())
1251+ if (auto const s = trim (text);
1252+ s.size () != text.size ())
1253+ {
12531254 text = s;
1255+ }
12541256
12551257 doc::Heading heading (std::move (text));
12561258 jd_.emplace_back (std::move (heading));
@@ -1259,8 +1261,10 @@ visitBlockCommandComment(
12591261 paragraph.children .erase (paragraph.children .begin ());
12601262 }
12611263
1262- if (! paragraph.children .empty ())
1264+ if (!paragraph.children .empty ())
1265+ {
12631266 jd_.emplace_back (std::move (paragraph));
1267+ }
12641268 }
12651269 return ;
12661270 }
0 commit comments