From 17dc022e1593ac4a91ce54d796ca67f81fc2fd36 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 24 Dec 2024 08:34:11 -0500 Subject: [PATCH] Fix rendering & and " in preview panel * Set plain text mode on elements that should never have styling * Revert html escaping as a prior fix --- src/gui/EntryPreviewWidget.cpp | 6 ++++-- src/gui/EntryPreviewWidget.ui | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp index 227e1c934..69f6b56dc 100644 --- a/src/gui/EntryPreviewWidget.cpp +++ b/src/gui/EntryPreviewWidget.cpp @@ -245,7 +245,7 @@ void EntryPreviewWidget::updateEntryHeaderLine() { Q_ASSERT(m_currentEntry); const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title()); - m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title.toHtmlEscaped())); + m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title)); m_ui->entryIcon->setPixmap(Icons::entryIconPixmap(m_currentEntry, IconSize::Large)); } @@ -302,10 +302,12 @@ void EntryPreviewWidget::setPasswordVisible(bool state) html += "" + QString(c).toHtmlEscaped() + ""; } // clang-format on + m_ui->entryPasswordLabel->setTextFormat(Qt::RichText); m_ui->entryPasswordLabel->setText(html); } else { // No color - m_ui->entryPasswordLabel->setText(password.toHtmlEscaped()); + m_ui->entryPasswordLabel->setTextFormat(Qt::PlainText); + m_ui->entryPasswordLabel->setText(password); } } else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) { m_ui->entryPasswordLabel->setText(""); diff --git a/src/gui/EntryPreviewWidget.ui b/src/gui/EntryPreviewWidget.ui index 92081ab18..9b4e49960 100644 --- a/src/gui/EntryPreviewWidget.ui +++ b/src/gui/EntryPreviewWidget.ui @@ -100,7 +100,7 @@ Qt::ClickFocus - Qt::AutoText + Qt::PlainText Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse @@ -279,6 +279,9 @@ + + Qt::ClickFocus + TextLabel @@ -316,6 +319,9 @@ https://example.com + + Qt::RichText + Qt::TextBrowserInteraction @@ -504,6 +510,9 @@ expired + + Qt::PlainText + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse