MCPcopy Create free account
hub / github.com/027xiguapi/code-box / handleSetContent

Function handleSetContent

utils/parseMarkdownHook.ts:18–37  ·  view source on GitHub ↗
(selectorDom, type?)

Source from the content-addressed store, hash-verified

16 const [aiType, setAiType] = useStorage("app-aiType")
17
18 const handleSetContent = (selectorDom, type?) => {
19 let markdown = turndownService.turndown(selectorDom)
20 markdown = `${markdown}
21 将上面的文字,翻译成中文并生成markdown`
22
23 setAiContent(markdown)
24 type = type || aiType
25
26 switch (type) {
27 case "kimi":
28 window.open("https://kimi.moonshot.cn/", "_blank")
29 break
30 case "chatgpt":
31 window.open("https://chatgpt.com", "_blank")
32 break
33 case "deepseek":
34 window.open("https://chat.deepseek.com/", "_blank")
35 break
36 }
37 }
38
39 return [aiContent, handleSetContent]
40}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected