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:
olwater
2026-07-01 20:34:10 +08:00
committed by GitHub
co-authored by CaIon
parent 5bf3468362
commit fda8177864
5 changed files with 203 additions and 16 deletions
+12 -2
View File
@@ -16,7 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { HtmlContent } from '@/components/html-content'
import {
HtmlContent,
type HtmlContentVariant,
} from '@/components/html-content'
import { Markdown } from '@/components/ui/markdown'
type RichContentMode = 'markdown' | 'html'
@@ -26,11 +29,18 @@ interface RichContentProps {
mode?: RichContentMode
breaks?: boolean
className?: string
htmlVariant?: HtmlContentVariant
}
export function RichContent(props: RichContentProps) {
if (props.mode === 'html') {
return <HtmlContent content={props.content} className={props.className} />
return (
<HtmlContent
content={props.content}
className={props.className}
variant={props.htmlVariant}
/>
)
}
return (