You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: md-fit strips meaningful content metadata (usernames, attribution) not just boilerplate #1900
md-fit should strip page chrome (navigation, footers, sidebars, cookie banners) but preserve meaningful content metadata like author names and attribution on user-generated content. Comment attribution (who said what) is semantic content, not boilerplate.
Current Behavior
md-fit strips comment author usernames and profile links from GitHub pages while keeping the comment body and date. The output shows commented Apr 6, 2026 with no indication of who wrote it.
This is expected behavior of the PruningContentFilter — it scores each HTML block on text density, link ratio, tag weight, and class patterns. Short metadata elements (usernames, timestamps) score low on density and get pruned alongside actual boilerplate.
On your GitHub gist page, the author <span class="author"> is short text, heavily linked, and the class matches the "comment" negative pattern — all of which push the score below the 0.48 threshold.
PR #1904 adds preserve_classes and preserve_tags params to PruningContentFilter so you can whitelist elements that should always be kept:
Activity
feat: add preserve_classes/preserve_tags to PruningContentFilter (unc…
hafezparast commentedon Apr 7, 2026
This is expected behavior of the
PruningContentFilter— it scores each HTML block on text density, link ratio, tag weight, and class patterns. Short metadata elements (usernames, timestamps) score low on density and get pruned alongside actual boilerplate.On your GitHub gist page, the author
<span class="author">is short text, heavily linked, and the class matches the "comment" negative pattern — all of which push the score below the 0.48 threshold.PR #1904 adds
preserve_classesandpreserve_tagsparams toPruningContentFilterso you can whitelist elements that should always be kept:Immediate workarounds (before the PR merges):
PruningContentFilter(threshold=0.35)— keeps more content but also more noiseBM25ContentFilter(user_query="author comments")instead — relevance-based, not density-basedTo test the whitelist before merge:
Merge pull request #1904 from hafezparast/fix/maysam-pruning-preserve…
ntohidi commentedon Jul 7, 2026
This is now on
developvia PR #1904 and will be included in the next release. Thanks for the report, @mattheworiordan.ntohidi commentedon Jul 8, 2026
This has been fixed and is available in the latest release, v0.9.1.