Documentation about the XML entity escape used by KDialog

Previously posted at KDE forum but no responses.

The new forum has a limitation that new users cannot put multiple links and images in the post, so I have to post the URLs as code. Sorry for the inconvenience.

Hello. I’m maintaining a cross-platform dialog library, and it uses KDialog under the hood. I encountered a problem about the markup language.

When it was two or thee years ago (in Ubuntu 20.04), kdialog (version 19.12) supports some XML entity escape like HTML, such as   (non-breaking space), & (&), " ("), ' ('), and so on.


However, it is found that in recent versions of KDialog, some entity are not supported anymore, while some still work.



I cannot find any KDE documentation that describes this change. When I tried figuring it out from the source code, I found that the code related to displaying text in the dialogs have never changed for years. Git blame shows this:

  • The text preprocessing function in KDialog -
  • KDialog sends the text to KMessageBox under the hood -
  • KMessageBox sends the text to QLabel to display them -

Could anyone tell me which version did this change happen, and what has been changed exactly?

See also: native-dialog-rs/native-dialog-rs#41

We’re switching to Qt 6, so maybe that’s where the change came from? We mostly use Qt for HTML/Rich Text stuff.

FWIW, I can’t reproduce the bug if I do kdialog --msgbox '<html><body>Non&nbsp;breaking&nbsp;spaces</body></html>'

I’m not sure… but the screenshot is of Arch Linux, and the kdialog it provides is still depending on Qt 5.


This information is useful! Thank you anyway.

Same can’t reproduce with both qt5 and qt6