diff --git a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx index acf731f4..91773cf6 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx @@ -57,7 +57,7 @@ const CodespanWithLink = ({ text, rawText, chatMessageLocation }: { text: string const [didComputeCodespanLink, setDidComputeCodespanLink] = useState(false) let link = undefined - if (rawText.endsWith("`")) { // if codespan was completed + if (rawText.endsWith('`')) { // if codespan was completed // get link from cache link = chatThreadService.getCodespanLink({ codespanStr: text, messageIdx, threadId }) @@ -120,11 +120,11 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. return null; } - if (t.type === "space") { + if (t.type === 'space') { return {t.raw} } - if (t.type === "code") { + if (t.type === 'code') { const [firstLine, remainingContents] = separateOutFirstLine(t.text) const firstLineIsURI = isValidUri(firstLine) && !codeURI const contents = firstLineIsURI ? (remainingContents?.trimStart() || '') : t.text // exclude first-line URI from contents @@ -152,7 +152,7 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. } if (options.isApplyEnabled && chatMessageLocation) { - const isCodeblockClosed = t.raw.trimEnd().endsWith('```') // user should only be able to Apply when the code has been closed (t.raw ends with "```") + const isCodeblockClosed = t.raw.trimEnd().endsWith('```') // user should only be able to Apply when the code has been closed (t.raw ends with '```') const applyBoxId = getApplyBoxId({ threadId: chatMessageLocation.threadId, @@ -179,7 +179,7 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. /> } - if (t.type === "heading") { + if (t.type === 'heading') { const HeadingTag = `h${t.depth}` as keyof JSX.IntrinsicElements @@ -188,7 +188,7 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. } - if (t.type === "table") { + if (t.type === 'table') { return (
@@ -217,14 +217,14 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. ) // return ( //
- //
+ //
// - // + // // {t.header.map((cell: any, index: number) => ( // @@ -237,8 +237,8 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. // {row.map((cell: any, cellIndex: number) => ( // @@ -251,32 +251,32 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. // ) } - if (t.type === "hr") { + if (t.type === 'hr') { return
} - if (t.type === "blockquote") { + if (t.type === 'blockquote') { return
{t.text}
} if (t.type === 'list_item') { return
  • - +
  • } - if (t.type === "list") { - const ListTag = t.ordered ? "ol" : "ul" + if (t.type === 'list') { + const ListTag = t.ordered ? 'ol' : 'ul' return ( {t.items.map((item, index) => (
  • {item.task && ( - + )} @@ -287,7 +287,7 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. ) } - if (t.type === "paragraph") { + if (t.type === 'paragraph') { const contents = <> {t.tokens.map((token, index) => ( {contents}

    } - if (t.type === "text" || t.type === "escape") { + if (t.type === 'text' || t.type === 'escape' || t.type === 'html') { return {t.raw} } - if (t.type === "def") { + if (t.type === 'def') { return <> // Definitions are typically not rendered } - if (t.type === "link") { + if (t.type === 'link') { return ( { window.open(t.href) }} @@ -325,7 +325,7 @@ const RenderToken = ({ token, inPTag, codeURI, chatMessageLocation, tokenIdx, .. ) } - if (t.type === "image") { + if (t.type === 'image') { return {t.text} } - if (t.type === "strong") { + if (t.type === 'strong') { return {t.text} } - if (t.type === "em") { + if (t.type === 'em') { return {t.text} } // inline code - if (t.type === "codespan" || t.type === "html") { + if (t.type === 'codespan') { if (options.isLinkDetectionEnabled && chatMessageLocation) { return } - if (t.type === "br") { + if (t.type === 'br') { return
    } // strikethrough - if (t.type === "del") { + if (t.type === 'del') { return {t.text} } // default return ( -
    - Unknown token rendered... +
    + Unknown token rendered...
    ) }
  • // {cell.raw} // // {cell.raw} //