QDoc: Chop carriage return at line continuation
A line that ends with ' \' (space backslash) is interpreted by QDoc as a
trailing-line-continuation symbol. On sources that are saved with
Windows line endings, the carriage return between the backslash and the
newline is treated as ordinary text while scanning the line. When a
blank line follows the continuation, the leading words of the argument
are silently dropped. This results in platform-dependent parsing
depending on whether the line employs Unix- or Windows-style line
endings.
QDoc now treats that carriage return as part of the line ending rather
than as content. A continued argument is scanned, joined, and returned
the same regardless of whether the source uses CRLF or LF endings, so
Windows-authored documentation produces the same output as its Unix
counterpart. A regression fixture with genuine CRLF bytes guards the
behavior.
Pick-to: 6.12
Fixes: QTBUG-119610
Change-Id: I30765040f27f0003d1ef9d05efb6ba1e22e9c39f
Reviewed-by: David Boddie <david.boddie@qt.io>
| commit | 5d5e3e57ceb6439e1edd2bbf96385f9583a07858 |
| parent | 78f4260df122139c696067efe287a604d6e37f36 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Fri, 24 Jul 2026 11:39:51 +0000 |
- M src/qdoc/qdoc/src/qdoc/docparser.cpp
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/crlf_line_continuation/.gitattributes
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/crlf_line_continuation/crlf_line_continuation.qdocconf
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/crlf_line_continuation/expected/html/crlf-line-continuation.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/crlf_line_continuation/expected/html/crlf-line-continuation.index
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/crlf_line_continuation/expected/html/images/sample.png
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/crlf_line_continuation/src/crlf_line_continuation.qdoc
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/crlf_line_continuation/src/images/sample.png