MCPcopy Index your code
hub / github.com/ChinaGodMan/UserScripts / convertToMarkdown

Function convertToMarkdown

web-clipper/web-clipper.user.js:513–518  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

511 }
512 // HTML2Markdown
513 function convertToMarkdown(element) {
514 var html = element.outerHTML
515 let turndownMd = turndownService.turndown(html)
516 turndownMd = turndownMd.replaceAll('[\n\n]', '[]') // 防止 <a> 元素嵌套的暂时方法,并不完善
517 return turndownMd
518 }
519
520 // 热键设置
521 const STORAGE_KEY = 'web-clipper-hotkey'

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected