@@ -322,6 +322,10 @@ ParameterCommentSubstitution substitutions[] = {
322322 {" \n " , " \n /// " },
323323};
324324
325+ char const * bad_suffixes[] = {
326+ // Doxygen interprets this as an unpaired formatting character.
327+ " \n ." };
328+
325329// Very long parameters need different formatting.
326330auto constexpr kShortParamFormat = " /// @param %s %s\n " ;
327331auto constexpr kLongParamFormat = R"""( /// @param %s %s
@@ -349,6 +353,9 @@ std::string FormattedCommentsForParameter(
349353 if (std::count (comment.begin (), comment.end (), ' \n ' ) > kTooManyLines ) {
350354 std::vector<absl::string_view> paragraphs = absl::StrSplit (comment, " \n\n " );
351355 auto brief = std::string{paragraphs.front ()};
356+ for (auto const & suffix : bad_suffixes) {
357+ brief = std::string{absl::StripSuffix (brief, suffix)};
358+ }
352359 for (auto & sub : substitutions) {
353360 sub.uses += absl::StrReplaceAll ({{sub.before , sub.after }}, &brief);
354361 }
@@ -357,6 +364,9 @@ std::string FormattedCommentsForParameter(
357364 method.input_type ()->full_name ());
358365 }
359366
367+ for (auto const & suffix : bad_suffixes) {
368+ comment = std::string{absl::StripSuffix (comment, suffix)};
369+ }
360370 for (auto & sub : substitutions) {
361371 sub.uses += absl::StrReplaceAll ({{sub.before , sub.after }}, &comment);
362372 }
0 commit comments