MCPcopy Create free account
hub / github.com/anomalyco/opencode / convertHTMLToMarkdown

Function convertHTMLToMarkdown

packages/opencode/src/tool/webfetch.ts:182–192  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

180}
181
182function convertHTMLToMarkdown(html: string): string {
183 const turndownService = new TurndownService({
184 headingStyle: "atx",
185 hr: "---",
186 bulletListMarker: "-",
187 codeBlockStyle: "fenced",
188 emDelimiter: "*",
189 })
190 turndownService.remove(["script", "style", "meta", "link"])
191 return turndownService.turndown(html)
192}

Callers 1

webfetch.tsFile · 0.70

Calls 1

removeMethod · 0.65

Tested by

no test coverage detected