Skip to content

fix(html): preserve case-insensitive checkbox types - #2681

Open
LI (ktz03) wants to merge 1 commit into
microsoft:mainfrom
ktz03:fix/html-checkbox-type-case
Open

LI (ktz03) wants to merge 1 commit into
microsoft:mainfrom
ktz03:fix/html-checkbox-type-case

Conversation

@ktz03

Copy link
Copy Markdown

HTML checkboxes with type="CHECKBOX" or mixed-case values currently lose their checked/unchecked markers during conversion. For example, <p><input type="CHECKBOX" checked>Task</p> becomes Task rather than [x] Task.

Match checkbox types using ASCII case-insensitive comparison, as required for HTML enumerated attributes. Keep missing, empty, unrelated, whitespace-padded, and non-ASCII type values ignored. Add public MarkItDown.convert_stream regressions for both checked states and those controls.

Validation on Windows with Python 3.14.3, markdownify 1.2.3, Beautiful Soup 4.15.0, and Magika 0.6.2:

  • The new regressions fail 6 cases on main and pass all 15 with the fix.
  • HTML and library infrastructure suites: 218 passed, 2 provider-backed tests skipped.
  • pre-commit run --all-files: passed (Black 23.7.0).

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.

1 participant