Skip to content

Preserve selected HTML subtrees with a passthrough option - #317

Open
Aschenbath wants to merge 1 commit into
matthewwithanm:developfrom
Aschenbath:fix/big20-20261123-bde6-markdownify-passthrough
Open

Aschenbath wants to merge 1 commit into
matthewwithanm:developfrom
Aschenbath:fix/big20-20261123-bde6-markdownify-passthrough

Conversation

@Aschenbath

Copy link
Copy Markdown

Add passthrough to preserve selected elements and their complete subtrees as HTML while converting surrounding content. It accepts tag names or a predicate over BeautifulSoup tags for attribute/regex criteria; --passthrough exposes tag-name selection on the CLI, and type declarations include both forms. Selection precedes strip/convert/custom converters and does not traverse the selected subtree.

Closes #79. Preserved content is not rewrapped or whitespace-normalized by paragraph/heading/table conversion; enclosing Markdown lists and blockquotes still apply indentation. HTML comes from BeautifulSoup serialization, so parser normalization, quotes, attribute ordering and entity spelling are documented rather than promising byte-identical source.

Full tests pass on Python 3.12 and 3.10 (121 each), along with Flake8, README lint and mypy API examples. The 25 feature regressions fail on unchanged upstream; one disabled-option compatibility case passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request - implement "passthrough" option to preserve selected elements

1 participant