diff --git a/client/lib/render-markdown.tsx b/client/lib/render-markdown.tsx index fda487f2..de8aebb5 100644 --- a/client/lib/render-markdown.tsx +++ b/client/lib/render-markdown.tsx @@ -60,20 +60,20 @@ renderer.listitem = (text, task, checked) => { return `
  • ${text}
  • ` } -// renderer.code = (code: string, language: string) => { -// return renderToStaticMarkup( -//
    -//             {/* {title && {title} } */}
    -//             {/* {language && title &&  {language} } */}
    -//             
    -//         
    -// ) -// } +renderer.code = (code: string, language: string) => { + return renderToStaticMarkup( +
    +            {/* {title && {title} } */}
    +            {/* {language && title &&  {language} } */}
    +            
    +        
    + ) +} marked.setOptions({ gfm: true, diff --git a/server/src/lib/render-markdown.tsx b/server/src/lib/render-markdown.tsx index ec34047d..de8aebb5 100644 --- a/server/src/lib/render-markdown.tsx +++ b/server/src/lib/render-markdown.tsx @@ -1,4 +1,4 @@ -import { marked } from 'marked' +import { marked, Lexer } from 'marked' import Highlight, { defaultProps, Language, } from 'prism-react-renderer' import { renderToStaticMarkup } from 'react-dom/server' @@ -95,8 +95,7 @@ const Code = ({ code, language, highlight, title, ...props }: { if (!language) return ( <> - + )