mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-06 17:46:23 +00:00
fix(web): 修复自定义 HTML 样式被过滤及排版间距异常的问题 (#5795)
* fix(web): 修复自定义 HTML 样式被过滤及排版间距异常的问题 * fix(web): isolate custom HTML rendering --------- Co-authored-by: CaIon <i@caion.me>
This commit is contained in:
+16
-1
@@ -57,11 +57,26 @@ export function Home() {
|
||||
)
|
||||
}
|
||||
|
||||
const contentIsHtml = isLikelyHtml(content)
|
||||
|
||||
if (contentIsHtml) {
|
||||
return (
|
||||
<PublicLayout showMainContainer={false}>
|
||||
<RichContent
|
||||
mode='html'
|
||||
htmlVariant='isolated'
|
||||
content={content}
|
||||
className='custom-home-content'
|
||||
/>
|
||||
</PublicLayout>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<PublicLayout>
|
||||
<div className='mx-auto max-w-6xl px-4 py-8'>
|
||||
<RichContent
|
||||
mode={isLikelyHtml(content) ? 'html' : 'markdown'}
|
||||
mode='markdown'
|
||||
content={content}
|
||||
className='custom-home-content'
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user