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:
+12
-2
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user