Skip to content

Commit 0a6def6

Browse files
authored
[mlir][doc] Emit \n if description not end with \n. (#112898)
This PR addresses a markdown formatting issue by ensuring a `\n` is emitted if the description string does not already end with one. Fixes #112672.
1 parent 2a6b09e commit 0a6def6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mlir/tools/mlir-tblgen/OpDocGen.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ void mlir::tblgen::emitSummary(StringRef summary, raw_ostream &os) {
7070
// nested in the op definition.
7171
void mlir::tblgen::emitDescription(StringRef description, raw_ostream &os) {
7272
raw_indented_ostream ros(os);
73-
ros.printReindented(description.rtrim(" \t"));
73+
StringRef trimmed = description.rtrim(" \t");
74+
ros.printReindented(trimmed);
75+
if (!trimmed.ends_with("\n"))
76+
ros << "\n";
7477
}
7578

7679
void mlir::tblgen::emitDescriptionComment(StringRef description,

0 commit comments

Comments
 (0)