MCPcopy Create free account
hub / github.com/AI45Lab/Code / html_to_text

Function html_to_text

core/src/tools/builtin/web_fetch.rs:151–154  ·  view source on GitHub ↗

Convert HTML to plain text using html2text (handles encoding, tags, scripts, etc.)

(html: &str)

Source from the content-addressed store, hash-verified

149
150/// Convert HTML to plain text using html2text (handles encoding, tags, scripts, etc.)
151fn html_to_text(html: &str) -> String {
152 html2text::from_read(html.as_bytes(), 120)
153 .unwrap_or_else(|_| String::from("[failed to parse HTML]"))
154}
155
156/// Convert HTML to markdown using htmd
157fn html_to_markdown(html: &str) -> String {

Callers 6

executeMethod · 0.85
html_to_markdownFunction · 0.85
test_html_to_text_basicFunction · 0.85

Calls

no outgoing calls

Tested by 4

test_html_to_text_basicFunction · 0.68