matthewwithanm / matthewwithanm/python-markdownify
Newlines in a table
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 203
- PR merge metrics
- No merged PRs in 30d
Description
Consider this input:
<table>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>
<div>Cell 4-1</div>
<div>Cell 4-2</div>
</td></tr>
</table>
Current output is:
| | |
| --- | --- |
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4-1 Cell 4-2 |
I'd like to get:
| | |
| --- | --- |
|Cell 1 | Cell 2 |
|Cell 3 | Cell 4-1<br>Cell 4-2 |
Rendered in GitHub as:
| Cell 1 | Cell 2 |
| Cell 3 | Cell 4-1 Cell 4-2 |
Since <br> isn't standard markdown, make it optional, but provide a way of doing it. I tried using convert_td hook but it seems to already get the text without the newline.
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 at the convert_td hook, which the report says receives table-cell text after the newline is lost, and trace how table contents are assembled. Define the option's expected behavior from the provided HTML and Markdown examples, then verify that the existing output remains unchanged when the option is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100