diff --git a/CHANGELOG.md b/CHANGELOG.md index ee9be22c75..e20670d7a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,8 @@ * ![Bugfix][badge-bugfix] Tables now honor column alignment in the HTML output. If a column does not explicitly specify its alignment, the parser defaults to it being right-aligned, whereas previously all cells were left-aligned. ([#511][github-511], [#989][github-989]) +* ![Bugfix][badge-bugfix] Code lines ending with `# hide` are now properly hidden for CRLF inputs. ([#991][github-991]) + ## Version `v0.21.5` * ![Bugfix][badge-bugfix] Deprecation warnings for `format` now get printed correctly when multiple formats are passed as a `Vector`. ([#967][github-967]) @@ -278,6 +280,7 @@ [github-971]: https://github.com/JuliaDocs/Documenter.jl/pull/971 [github-980]: https://github.com/JuliaDocs/Documenter.jl/pull/980 [github-989]: https://github.com/JuliaDocs/Documenter.jl/pull/989 +[github-991]: https://github.com/JuliaDocs/Documenter.jl/pull/991 [documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl [documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl diff --git a/src/Expanders.jl b/src/Expanders.jl index 1f0e972994..cd1c2d163a 100644 --- a/src/Expanders.jl +++ b/src/Expanders.jl @@ -677,7 +677,7 @@ end # Remove any `# hide` lines, leading/trailing blank lines, and trailing whitespace. function droplines(code; skip = 0) buffer = IOBuffer() - for line in split(code, '\n')[(skip + 1):end] + for line in split(code, r"\r?\n")[(skip + 1):end] occursin(r"^(.*)#\s*hide$", line) && continue println(buffer, rstrip(line)) end