Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-141140

Escape codes in source text are interpreted by script output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.11
    • Build tools: Other
    • None
    • Linux/Wayland

      The "clang-format suggests changes" commit hook / prompt does not escape backslashes in the source text, resulting in faulty output when the changes affect e.g. qdoc files/comments with escape codes.

      For example the \a and \c in the text below are printed as actual control characters resulting in a terminal bell sound and the rest of the diff string being unprinted after \c.

      clang-format output:
      diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
      index 8857e5336..d933e7a36 100644
      --- a/src/webenginewidgets/api/qwebengineview.cpp
      +++ b/src/webenginewidgets/api/qwebengineview.cpp
      @@ -1479,13 +1479,15 @@ void QWebEngineView::printToPdf(const std::function<void(const QByteArray&)> &re
       */ /*!
      -    Renders the current content of the page into a temporary PDF document, then prints it using  printer.
      +    Renders the current content of the page into a temporary PDF document, then prints it using
      +   printer.
           The settings for creating and printing the PDF document will be retrieved from the  printer
           object.-    When finished the signal printFinished() is emitted with the clang-format suggests changes in the format. You can run:
        git clang-format HEAD~1
      and amend the commit with those changes that you agree with.
      [dev 8eed5166f] Interrupt printing when QWEPage is destroyed
       Date: Tue Oct 14 11:19:12 2025 +0200
       5 files changed, 23 insertions(+), 7 deletions(-) 

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtbuildsystem Qt Build System Team
            moheim Moss Heim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes