Allow heading tags (h1-h6) in ContentSanitizer so news editor headings render
This commit is contained in:
@@ -3,12 +3,31 @@ import React from 'react'
|
||||
import { createInertiaApp } from '@inertiajs/react'
|
||||
import UploadPage from './Pages/Upload/Index'
|
||||
|
||||
const pages = {
|
||||
const staticPages = {
|
||||
'Upload/Index': UploadPage,
|
||||
}
|
||||
|
||||
const dynamicPages = Object.fromEntries(
|
||||
Object.entries(import.meta.glob('./Pages/Enhance/**/*.jsx')).map(([path, resolver]) => [
|
||||
path.replace('./Pages/', '').replace('.jsx', ''),
|
||||
resolver,
|
||||
])
|
||||
)
|
||||
|
||||
createInertiaApp({
|
||||
resolve: (name) => pages[name],
|
||||
resolve: (name) => {
|
||||
if (staticPages[name]) {
|
||||
return staticPages[name]
|
||||
}
|
||||
|
||||
const page = dynamicPages[name]
|
||||
|
||||
if (!page) {
|
||||
throw new Error(`Unknown upload page: ${name}`)
|
||||
}
|
||||
|
||||
return page().then((module) => module.default)
|
||||
},
|
||||
setup({ el, App, props }) {
|
||||
mountInertiaRoot(el, App, props)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user