Accept full meta HTML in Tags & Badges (name is label only).
Admins paste complete <meta> tags as the value; the name field is only a list label. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
68b985dee3
commit
eb9b8b9fa3
@@ -27,14 +27,20 @@
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
color: var(--text-primary);
|
||||
background: rgba(15, 23, 42, 0.55);
|
||||
border: 1px solid rgba(148, 163, 184, 0.28);
|
||||
color: #0f172a;
|
||||
background: #f8fafc;
|
||||
border: 1px solid rgba(148, 163, 184, 0.5);
|
||||
border-radius: 6px;
|
||||
unicode-bidi: isolate;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:global(html[data-theme='dark']) .metaSample {
|
||||
color: var(--text-primary);
|
||||
background: rgba(15, 23, 42, 0.55);
|
||||
border-color: rgba(148, 163, 184, 0.28);
|
||||
}
|
||||
|
||||
.metaList {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
@@ -66,15 +72,21 @@
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
background: rgba(15, 23, 42, 0.45);
|
||||
border: 1px solid rgba(148, 163, 184, 0.25);
|
||||
color: #0f172a;
|
||||
background: #ffffff;
|
||||
border: 1px solid rgba(148, 163, 184, 0.5);
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:global(html[data-theme='dark']) .metaName {
|
||||
color: var(--text-primary);
|
||||
background: rgba(15, 23, 42, 0.45);
|
||||
border-color: rgba(148, 163, 184, 0.25);
|
||||
}
|
||||
|
||||
.metaValue {
|
||||
min-width: 0;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -23,7 +23,7 @@ import sharedStyles from './ProductSettingsPage.module.css'
|
||||
import settingsStyles from './WebsiteSettingsPage.module.css'
|
||||
import styles from './WebsiteBadgesPage.module.css'
|
||||
|
||||
const META_NAME_RE = /^[a-zA-Z0-9_.:-]{1,80}$/
|
||||
const META_HTML_RE = /^<meta\b[^>]*>/i
|
||||
const MAX_META_TAGS = 40
|
||||
|
||||
type TrustKind = 'enamad' | 'samandehi'
|
||||
@@ -152,11 +152,11 @@ export function WebsiteBadgesPage() {
|
||||
const name = tag.name.trim()
|
||||
const content = tag.content.trim()
|
||||
if (!name && !content) continue
|
||||
if (!name || !META_NAME_RE.test(name)) {
|
||||
if (!name) {
|
||||
setError(t('website.badges.meta.nameInvalid'))
|
||||
return
|
||||
}
|
||||
if (!content) {
|
||||
if (!content || !META_HTML_RE.test(content)) {
|
||||
setError(t('website.badges.meta.contentRequired'))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user