Allow heading tags (h1-h6) in ContentSanitizer so news editor headings render
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
getContentTypeValue,
|
||||
getProcessingTransparencyLabel,
|
||||
} from '../../lib/uploadUtils'
|
||||
import { validateMarkdownLiteContent } from '../../utils/contentValidation'
|
||||
|
||||
// ─── Wizard step config ───────────────────────────────────────────────────────
|
||||
const wizardSteps = [
|
||||
@@ -335,6 +336,15 @@ export default function UploadWizard({
|
||||
if (metadata.rootCategoryId && requiresSubCategory && !metadata.subCategoryId) {
|
||||
errors.category = 'Subcategory is required for the selected category.'
|
||||
}
|
||||
if (!Array.isArray(metadata.tags) || metadata.tags.length === 0) errors.tags = 'Add at least one tag.'
|
||||
if (!String(metadata.description || '').trim()) {
|
||||
errors.description = 'Description is required.'
|
||||
} else {
|
||||
const descriptionErrors = validateMarkdownLiteContent(metadata.description)
|
||||
if (descriptionErrors.length > 0) {
|
||||
errors.description = descriptionErrors[0]
|
||||
}
|
||||
}
|
||||
if (!metadata.rightsAccepted) errors.rights = 'Rights confirmation is required.'
|
||||
return errors
|
||||
}, [metadata, requiresSubCategory])
|
||||
@@ -381,9 +391,11 @@ export default function UploadWizard({
|
||||
hasCompleteCategory &&
|
||||
hasTag &&
|
||||
hasRequiredScreenshot &&
|
||||
String(metadata.description || '').trim() &&
|
||||
!metadataErrors.description &&
|
||||
metadata.rightsAccepted &&
|
||||
machine.state !== machineStates.publishing
|
||||
), [uploadReady, hasTitle, hasCompleteCategory, hasTag, hasRequiredScreenshot, metadata.rightsAccepted, machine.state])
|
||||
), [uploadReady, hasTitle, hasCompleteCategory, hasTag, hasRequiredScreenshot, metadata.description, metadata.rightsAccepted, metadataErrors.description, machine.state])
|
||||
|
||||
const canScheduleSubmit = useMemo(() => {
|
||||
if (!canPublish) return false
|
||||
|
||||
Reference in New Issue
Block a user