matthewwithanm / matthewwithanm/python-markdownify
Ignored div tag removes spaces.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 203
- PR merge metrics
- No merged PRs in 30d
Description
When I set skip=["div"] and convert the following HTML,
<span>Ignored <div>Still ignored</div> tag.</span>
The result is IgnoredStill ignoredtag. I was expecting Ignored Still ignored tag.
Then I tried extending the converter class, so convert_div(...) returns " " + text + " ", but that resulted in a trailing space if div was the last tag (e.g., <span>Ignored <div>Still ignored</div></span> converts to Ignored Still ignored <- trailing space).
Shouldn't the trailing space have been stripped by the default strip_document=STRIP?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing both examples and tracing the converter's skip handling, including the mentioned convert_div(...) path and strip_document=STRIP behavior. Confirm that skipped div content preserves needed surrounding spaces without leaving a trailing space.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100