Add remark-gfm for markdown table rendering in Knowledge Base

Tables are a GitHub Flavored Markdown extension not supported by
react-markdown's default parser. Added remark-gfm plugin so tables,
strikethrough, and task lists render correctly in KB articles.
This commit is contained in:
Jordan Ramos
2026-06-16 14:03:57 -06:00
parent 93efb70d1c
commit 8d47f67318
3 changed files with 3102 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import React, { useState, useEffect, useRef } from 'react';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import rehypeSanitize from 'rehype-sanitize';
import mermaid from 'mermaid';
import { X, Download, Loader, AlertCircle, FileText, File } from 'lucide-react';
@@ -234,6 +235,7 @@ export default function KnowledgeBaseViewer({ article, onClose }) {
{isMarkdown && (
<div className="markdown-content">
<ReactMarkdown
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeSanitize]}
components={{
code({ inline, className, children }) {