[mlir][docgen] Handle Windows line endings in doc generation.
authorScott Todd <scotttodd@google.com>
Thu, 22 Jun 2023 19:27:41 +0000 (12:27 -0700)
committerScott Todd <scotttodd@google.com>
Thu, 29 Jun 2023 16:56:49 +0000 (09:56 -0700)
commitc304be7cfdd2261811671feb252e31222365b475
tree42e57d21fe6e61df5b614bfe94c32154537a4a6e
parent4986f3f2f220e4fd2fef4b08e550b399c9f45a9f
[mlir][docgen] Handle Windows line endings in doc generation.

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.

Differential Revision: https://reviews.llvm.org/D153591
mlir/include/mlir/Support/IndentedOstream.h
mlir/unittests/Support/IndentedOstreamTest.cpp