@@ -1026,22 +1026,30 @@ visitBlockCommandComment(
10261026 visitChildren (C->getParagraph ());
10271027 if (! paragraph.children .empty ())
10281028 {
1029- // the first TextComment is the heading text
1030- doc::String text (std::move (
1031- paragraph.children .front ()->string ));
1032-
1033- // VFALCO Unfortunately clang puts at least
1034- // one space in front of the text, which seems
1035- // incorrect.
1036- auto const s = trim (text);
1037- if (s.size () != text.size ())
1038- text = s;
1039-
1040- doc::Heading heading (std::move (text));
1041- jd_.emplace_back (std::move (heading));
1042-
1043- // remaining TextComment, if any
1044- paragraph.children .erase (paragraph.children .begin ());
1029+ if (C->getNumArgs () > 0 )
1030+ {
1031+ jd_.emplace_back (doc::Heading (C->getArgText (0 ).str ()));
1032+ }
1033+ else
1034+ {
1035+ // the first TextComment is the heading text
1036+ doc::String text (std::move (
1037+ paragraph.children .front ()->string ));
1038+
1039+ // VFALCO Unfortunately clang puts at least
1040+ // one space in front of the text, which seems
1041+ // incorrect.
1042+ auto const s = trim (text);
1043+ if (s.size () != text.size ())
1044+ text = s;
1045+
1046+ doc::Heading heading (std::move (text));
1047+ jd_.emplace_back (std::move (heading));
1048+
1049+ // remaining TextComment, if any
1050+ paragraph.children .erase (paragraph.children .begin ());
1051+ }
1052+
10451053 if (! paragraph.children .empty ())
10461054 jd_.emplace_back (std::move (paragraph));
10471055 }
0 commit comments