Commit 7b8ceea
committed
fix: preserve text nested inside <br> by html.parser
Python's html.parser can wrap text following <br /> (with a space) inside
the <br> element as child content when the <br> is preceded by a sibling
<br> without a slash. convert_br received the nested text via its `text`
parameter but discarded it, silently dropping characters from the output.
Append `text` to the returned line-break marker so that any accidentally
nested content is always preserved.
Closes #2441 parent add391a commit 7b8ceea
2 files changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
| 481 | + | |
482 | 482 | | |
483 | | - | |
| 483 | + | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
0 commit comments