Skip to content

Conversation

@ErikApption
Copy link
Contributor

This PR is to address docling-project/docling#2167

Checkboxes are labelled correctly by docling but are not rendered in the markdown.

  • This PR prepends [x] or [ ] to any text that is labelled as checkbox through markdown.py serializer.
  • A new unit test is added and follows other unit tests. The test is based on this form
  • No regression error on other tests

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

DCO Check Passed

Thanks @ErikApption, all your commits are properly signed off. 🎉

@mergify
Copy link

mergify bot commented Sep 3, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

🟢 Require two reviewer for test updates

Wonderful, this rule succeeded.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

@dosubot
Copy link

dosubot bot commented Sep 3, 2025

Related Documentation

Checked 2 published document(s). No updates required.

How did I do? Any feedback?  Join Discord

@ErikApption ErikApption changed the title added support for rendering checkboxes in markdown feat: rendering of checkboxes in markdown Sep 3, 2025
@dolfim-ibm
Copy link
Contributor

Interesting. More a curiosity: Do we know if the marko library we use in Docling to parse markdown will understand these checkboxes?

@PeterStaar-IBM
Copy link
Contributor

I think we need to follow the standard markdown convention. In standard Markdown, checkboxes are represented using this syntax:

Unselected checkbox:

- [ ] Unchecked item

Selected checkbox:

- [x] Checked item

@PeterStaar-IBM
Copy link
Contributor

@ErikApption Could you do the fixes we requested?

@ErikApption
Copy link
Contributor Author

@ErikApption Could you do the fixes we requested?

Done. Alternatively was wondering about making the checkbox renders as parameters the same way there is a parameter for page break but I think this will be a better ootb experience

@PeterStaar-IBM
Copy link
Contributor

@ErikApption Could you do the fixes we requested?

Done. Alternatively was wondering about making the checkbox renders as parameters the same way there is a parameter for page break but I think this will be a better ootb experience

ok now you will need to rerun the test to generate the update ground-truth files and after that run the pre-commit (uv run pre-commit --all-files)

@ErikApption
Copy link
Contributor Author

@ErikApption Could you do the fixes we requested?

Done. Alternatively was wondering about making the checkbox renders as parameters the same way there is a parameter for page break but I think this will be a better ootb experience

ok now you will need to rerun the test to generate the update ground-truth files and after that run the pre-commit (uv run pre-commit --all-files)

Updated the truth files. All unit tests are passing again

@PeterStaar-IBM
Copy link
Contributor

@ErikApption Could you do the fixes we requested?

Done. Alternatively was wondering about making the checkbox renders as parameters the same way there is a parameter for page break but I think this will be a better ootb experience

ok now you will need to rerun the test to generate the update ground-truth files and after that run the pre-commit (uv run pre-commit --all-files)

Updated the truth files. All unit tests are passing again

yes, but you also need to run the formatting, you should see,?

taa@Munlochy docling-core % uv run pre-commit run --all-files
Black....................................................................Passed
isort....................................................................Passed
autoflake................................................................Passed
MyPy.....................................................................Passed
Flake8...................................................................Passed
Pytest...................................................................Passed
Docs.....................................................................Passed
uv-lock..................................................................Passed

@ErikApption
Copy link
Contributor Author

yes, but you also need to run the formatting, you should see,?

Got it! I was missing the run twice from your previous pre-commit command

@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@PeterStaar-IBM PeterStaar-IBM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@PeterStaar-IBM
Copy link
Contributor

@ErikApption nearly there, seems you need to sign of every commit (-s flag in git commit).

I, Erik <[email protected]>, hereby add my Signed-off-by to this commit: fc7a57e
I, Erik <[email protected]>, hereby add my Signed-off-by to this commit: 7ea737e
I, Erik <[email protected]>, hereby add my Signed-off-by to this commit: 5c431b5

Signed-off-by: Erik <[email protected]>
@PeterStaar-IBM PeterStaar-IBM merged commit abfa81f into docling-project:main Oct 1, 2025
11 checks passed
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.

3 participants