mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
fix: decode HTML entities in entry titles
This commit is contained in:
parent
d3a78da766
commit
98238cd1f3
1 changed files with 12 additions and 1 deletions
|
|
@ -10,8 +10,19 @@ export function formatBytes(bytes) {
|
|||
return `${size.toFixed(unit === 0 ? 0 : 1)} ${units[unit]}`;
|
||||
}
|
||||
|
||||
export function decodeHtmlEntities(str) {
|
||||
if (!str) return str;
|
||||
return str
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
export function valueText(value) {
|
||||
return value ?? "";
|
||||
return decodeHtmlEntities(value) ?? "";
|
||||
}
|
||||
|
||||
export function formatTimestamp(value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue