refactor(desktop): consolidate desktop-electron into desktop package (#25822)

This commit is contained in:
Brendan Allan 2026-05-05 13:43:36 +08:00 committed by GitHub
commit b4147c8d08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
441 changed files with 113 additions and 13439 deletions

View file

@ -0,0 +1,16 @@
import { marked, type Tokens } from "marked"
const renderer = new marked.Renderer()
renderer.link = ({ href, title, text }: Tokens.Link) => {
const titleAttr = title ? ` title="${title}"` : ""
return `<a href="${href}"${titleAttr} class="external-link" target="_blank" rel="noopener noreferrer">${text}</a>`
}
export function parseMarkdown(input: string) {
return marked(input, {
renderer,
breaks: false,
gfm: true,
})
}