Browse Source

fix: view workflow log detail page crash (#5474)

tags/0.6.12
Joel 1 year ago
parent
commit
e88f5607ac
No account linked to committer's email address
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      web/app/components/base/markdown.tsx

+ 5
- 2
web/app/components/base/markdown.tsx View File

return language.charAt(0).toUpperCase() + language.substring(1) return language.charAt(0).toUpperCase() + language.substring(1)
} }


const preprocessLaTeX = (content: string) =>
content.replace(/\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`)
const preprocessLaTeX = (content: string) => {
if (typeof content !== 'string')
return content
return content.replace(/\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`)
.replace(/\\\((.*?)\\\)/gs, (_, equation) => `$${equation}$`) .replace(/\\\((.*?)\\\)/gs, (_, equation) => `$${equation}$`)
}


export function PreCode(props: { children: any }) { export function PreCode(props: { children: any }) {
const ref = useRef<HTMLPreElement>(null) const ref = useRef<HTMLPreElement>(null)

Loading…
Cancel
Save