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!

貢獻者指南