mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 16:59:44 -05:00
Fix display issues of entry attributes in preview pane
* Fix #5755 - HTML escape attributes prior to preview * Place attribute preview into a table and convert line breaks
This commit is contained in:
parent
2ee4168956
commit
e8dfa9cfa1
@ -286,14 +286,18 @@ void EntryPreviewWidget::updateEntryAdvancedTab()
|
||||
|
||||
setTabEnabled(m_ui->entryTabWidget, m_ui->entryAdvancedTab, hasAttributes || hasAttachments);
|
||||
if (hasAttributes) {
|
||||
QString attributesText;
|
||||
QString attributesText("<table>");
|
||||
for (const QString& key : customAttributes) {
|
||||
QString value = m_currentEntry->attributes()->value(key);
|
||||
QString value;
|
||||
if (m_currentEntry->attributes()->isProtected(key)) {
|
||||
value = "<i>" + tr("[PROTECTED]") + "</i>";
|
||||
} else {
|
||||
value = m_currentEntry->attributes()->value(key).toHtmlEscaped();
|
||||
value.replace('\n', QLatin1String("<br/>"));
|
||||
}
|
||||
attributesText.append(tr("<b>%1</b>: %2", "attributes line").arg(key, value).append("<br/>"));
|
||||
attributesText.append(tr("<tr><td><b>%1</b>:</td><td>%2</td></tr>", "attributes line").arg(key, value));
|
||||
}
|
||||
attributesText.append("</table>");
|
||||
m_ui->entryAttributesEdit->setText(attributesText);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user