forked from kafene/netscape-bookmark-parser
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to keep description formatting. Fixes #42
- Loading branch information
1 parent
c1818b4
commit 6dbb72a
Showing
4 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Shaarli\NetscapeBookmarkParser; | ||
|
||
class ParseShaarliWithTabsAndSpacesTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Delete log file. | ||
*/ | ||
public function tearDown() | ||
{ | ||
@unlink(LoggerTestsUtils::getLogFile()); | ||
} | ||
|
||
/** | ||
* Parse flat Chromium bookmarks (no directories) | ||
*/ | ||
public function testParseFlat() | ||
{ | ||
$parser = new NetscapeBookmarkParser(false, null, '1'); | ||
$bkm = $parser->parseFile('tests/input/shaarli_with_tabs_and_spaces.htm'); | ||
|
||
static::assertSame( | ||
trim(file_get_contents('tests/output/shaarli_with_tabs_and_spaces.txt')), | ||
$bkm[0]['note'] | ||
); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
I will write some formating using spaces: | ||
|
||
* For example, | ||
* lists, | ||
+ but also | ||
+ sublists | ||
* use spaces. | ||
|
||
Also code: | ||
|
||
``` | ||
foreach ($data['linksToDisplay'] as $key => $bookmark) { | ||
$length = strlen($bookmark['title']) + (342 * strlen($bookmark['description'])) / 836; | ||
if (! empty($bookmark['thumbnail'])) { | ||
$length += 100; // 1 thumbnails roughly takes 100 pixels height. | ||
} | ||
} | ||
``` |