Migrating from upstream
This package ports defuddle 0.19.13. The behavior follows upstream; the names follow .NET conventions.
Entry points
Section titled “Entry points”| JavaScript | C# |
|---|---|
new Defuddle(document, options) |
new DefuddleParser(document, options) |
defuddle.parse() |
parser.Parse() |
defuddle.parseAsync() |
parser.ParseAsync(cancellationToken) |
await Defuddle(document, url, options) from defuddle/node |
await DefuddleParser.ParseHtmlAsync(html, new DefuddleOptions { Url = url }) |
createMarkdownContent(html, url) |
MarkdownConverter.CreateMarkdownContent(html, url) |
npx defuddle parse |
defuddle parse, from the Defuddle.Cli tool |
There is one library package. The core, full, and Node.js bundles of upstream have no equivalent. The DOM is AngleSharp instead of the browser, linkedom, or JSDOM.
Differences
Section titled “Differences”- Math follows upstream’s full bundle from MathML to LaTeX (a port of
mathml-to-latex). The LaTeX to MathML converter,temml, is not ported, so LaTeX-only math stays LaTeX text. - AngleSharp runs no page scripts and computes no layout. Only inline styles and attributes show whether an element is hidden or small, and the YouTube extractor reads a transcript panel that is already in the HTML but cannot open one.
- Without a page URL, relative links stay as written, as upstream.
- HTML nested more than 512 levels deep is not processed: the content is the plain text of the page.
Options
Section titled “Options”| JavaScript | C# |
|---|---|
debug |
Debug |
url |
Url |
markdown |
Markdown |
separateMarkdown |
SeparateMarkdown |
removeExactSelectors |
RemoveExactSelectors |
removePartialSelectors |
RemovePartialSelectors |
removeImages |
RemoveImages |
useAsync |
UseAsync |
removeHiddenElements |
RemoveHiddenElements |
removeLowScoring |
RemoveLowScoring |
removeSmallImages |
RemoveSmallImages |
standardize |
Standardize |
removeContentPatterns |
RemoveContentPatterns |
contentSelector |
ContentSelector |
language |
Language |
includeReplies: 'extractors' |
IncludeReplies = IncludeReplies.Extractors |
includeReplies: true |
IncludeReplies = IncludeReplies.All |
includeReplies: false |
IncludeReplies = IncludeReplies.None |
profile |
Profile |
fetch |
HttpClient |
Response
Section titled “Response”Each property of the JavaScript response has the same name in PascalCase on DefuddleResponse.
| JavaScript type | C# type |
|---|---|
schemaOrgData: any |
JsonNode? SchemaOrgData |
metaTags: MetaTagItem[] |
IReadOnlyList<MetaTagItem>? MetaTags |
debug: DebugInfo |
DebugInfo? Debug |
profile: Record<string, number> |
IReadOnlyDictionary<string, double>? Profile |
variables: { [key: string]: string } |
IReadOnlyDictionary<string, string>? Variables |
MIT · Copyright 2025 Steph Ango (@kepano) · unofficial community port of defuddle