fix(ui): address second round of PR review comments

- Replace hardcoded gap: 20px with var(--bui-space-5) in metadata row
- Trim leading whitespace from href before unsafe-scheme check to prevent bypass

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2026-04-21 09:34:34 +01:00
parent 4dfd2f1284
commit ea11646d8d
2 changed files with 4 additions and 2 deletions
@@ -68,7 +68,7 @@
display: flex;
flex-direction: row;
align-items: center;
gap: 20px;
gap: var(--bui-space-5);
flex-wrap: wrap;
}
+3 -1
View File
@@ -49,7 +49,9 @@ function renderInlineMarkdown(text: string): React.ReactNode[] {
if (match.index > last) {
parts.push(text.slice(last, match.index));
}
const href = match[2];
// Trim leading whitespace/control chars before scheme check to prevent
// bypass via inputs like " javascript:alert(1)".
const href = match[2].trimStart();
const label = match[1];
if (UNSAFE_HREF_RE.test(href)) {
parts.push(label);