The printReindented function searches for Unix style line endings (\n), but strings may have Windows style line endings (\r\n). Prior to this change, generated document sections could have extra indentation, which some markdown renderers interpret as code blocks rather than paragraphs.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Support/IndentedOstream.h | ||
---|---|---|
117 | Could we use rtrim('\\r') on the StringRef of the line? |
Comment Actions
I'm thoroughly confused by arc and Phabricator, but I updated the change a few times...
mlir/include/mlir/Support/IndentedOstream.h | ||
---|---|---|
117 | Yep! Here's the code flow on the test case now (note that the output now has "\r\n", but the indentation is correct): // Unix "\n\n\n First line\n second line" // split 1: "" "\n\n First line\n second line" // split 2: "" "\n First line\n second line" // ----------------------------- // Windows "\r\n\r\n\r\n First line\r\n second line" // split 1: "\r" // <-- trim this so it's empty string "\r\n\r\n First line\r\n second line" |
Comment Actions
I don't think I have write access to land this myself. If I did, I'd probably wait until Monday... but I wouldn't object to someone merging earlier than that.
Comment Actions
Okay, we're back in typical business hours now. Could you / someone merge this for me? I can also see about getting commit access myself.
Could we use rtrim('\\r') on the StringRef of the line?