Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TruncateInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface TruncateInterface
public function truncate(
$text,
$length = 100,
$ending = '...',
$ending = '',
$exact = false,
$considerHtml = true
);
Expand Down
2 changes: 1 addition & 1 deletion src/TruncateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function create()
public function truncate(
$text,
$length = 100,
$ending = '...',
$ending = '',
$exact = false,
$considerHtml = true
) {
Expand Down
8 changes: 4 additions & 4 deletions tests/TruncateServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public function setUp()
public function provider()
{
return array(
array('<p>Hello world!</p>', 10, '<p>Hello...</p>'),
array('<p>Hello world!</p>', 10, '<p>Hello</p>'),
array('<p>Hello world!</p>', 30, '<p>Hello world!</p>'),
array('<p>Hello <b>World!</b> blah blah blah</p>', 20, '<p>Hello <b>World!</b>...</p>'),
array('<b>One</b><b>Two</b> <b>Three</b>', 10, '<b>One</b><b>Two</b>...'),
array('<p>Hello world! <img src="http://img.test.com/img.jpg" /></p>', 10, '<p>Hello...</p>'),
array('<p>Hello <b>World!</b> blah blah blah</p>', 20, '<p>Hello <b>World!</b></p>'),
array('<b>One</b><b>Two</b> <b>Three</b>', 10, '<b>One</b><b>Two</b>'),
array('<p>Hello world! <img src="http://img.test.com/img.jpg" /></p>', 10, '<p>Hello</p>'),
array('<p>Hello world! <img src="http://img.test.com/img.jpg" /></p>', 20, '<p>Hello world! <img src="http://img.test.com/img.jpg" /></p>'),
);
}
Expand Down