diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index 05c9f1a52ae..d7d53ca5f0c 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -142,12 +142,15 @@ void BaseHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos, Re void BaseHoverHandler::decorateToolTip() { - m_toolTip = m_toolTip.toHtmlEscaped(); + if (!m_toolTip.isEmpty()) + m_toolTip = "
" + m_toolTip.toHtmlEscaped().replace('\n', "
") + "
" + m_toolTip + "
" + helpContents + "
"); + if (!helpContents.isEmpty()) { + m_toolTip = m_toolTip.isEmpty() ? helpContents + : (m_toolTip + "" + helpContents + "
"); + } } }