html_to_markdown
Convert HTML to Markdown (best-effort, inherently lossy on complex HTML).
Parameters
- inputstringone of
inputorsource_key - Literal HTML string; supports
${ctx.key}interpolation. - source_keystringone of
inputorsource_key - Context key whose value contains the HTML text.
- output_keystringdefault "markdown"
- Context key where the resulting Markdown is stored.
Providing both
inputandsource_keyis an error.
Context Output
<output_key>(defaultmarkdown) — the generated Markdown string.
Example
local flow = Flow.new("convert_html")
flow:step("fetch", nodes.http_request({
url = "https://example.com/page",
output_key = "html_content"
}))
flow:step("convert", nodes.html_to_markdown({
source_key = "html_content",
output_key = "markdown"
})):depends_on("fetch")
flow:step("done", nodes.log({
message = "Markdown result: ${ctx.markdown}"
})):depends_on("convert")
return flow