Fix rendering & and " in password preview

This commit is contained in:
Jonathan White 2024-12-24 08:34:11 -05:00
parent af0c1644a6
commit 984d4e4664
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01

View File

@ -302,10 +302,12 @@ void EntryPreviewWidget::setPasswordVisible(bool state)
html += "<span style=\"color: " + QString(color) + ";\">" + QString(c).toHtmlEscaped() + "</span>";
}
// 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("");