soundasleep/html2text

Surpressing multiple brs

开放

#49 创建于 2017年5月24日

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

仓库指标

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

描述

In your code you remove 'unnecessary empty lines':

// remove unnecessary empty lines
$output = preg_replace("/\n\n\n*/im", "\n\n", $output);

This actually leads to the removal of intended empty lines (at least in my case). It would be great to have some configuration for things like this. Should I submit a PR for this?

Just to give you an example:

Hello <br><br><br> lets test this <br><br><br> Cheers!

is converted to

Hello

lets test this

Cheers!

But I would expect:

Hello


lets test this


Cheers!

贡献者指南