soundasleep/html2text

Abusive removal of br nodes leads to incorrect output

开放

#54 创建于 2017年10月17日

 (4 条评论) (0 个反应) (0 位负责人)HTML (138 个派生)github user discovery
hacktoberfest

仓库指标

星标
 (485 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Hello !

There is some code doing intentional removal of nodes when they are the last child of a node that also contained text. Here's a very simple example about how this can lead to incorrect results (this is stuff I'm receiving from bad html emails) :

<font size="+1">Vikings: Wolves of Midgard<br></font><font size="+1">Valkyria Chronicles<br>
<br>
World Of Warcraft Battlechest</font>

The expected output would be

Vikings: Wolves of Midgard
Valkyria Chronicles

World Of Warcraft Battlechest

The actual output is:

Vikings: Wolves of MidgardValkyria Chronicles

World Of Warcraft Battlechest

贡献者指南