diff --git a/NetscapeBookmarkParser.php b/NetscapeBookmarkParser.php
index 92829c9..aacf984 100644
--- a/NetscapeBookmarkParser.php
+++ b/NetscapeBookmarkParser.php
@@ -321,15 +321,15 @@ public static function sanitizeString($bookmarkString)
// trim whitespace
$sanitized = trim($sanitized);
- // trim carriage returns, replace tabs by a single space
- $sanitized = str_replace(array("\r", "\t"), array('',' '), $sanitized);
+ // trim carriage returns
+ $sanitized = str_replace("\r", '', $sanitized);
// convert multiline descriptions to one-line descriptions
// line feeds are converted to
$sanitized = preg_replace_callback(
'@
+
diff --git a/tests/output/shaarli_with_tabs_and_spaces.txt b/tests/output/shaarli_with_tabs_and_spaces.txt new file mode 100644 index 0000000..bba2272 --- /dev/null +++ b/tests/output/shaarli_with_tabs_and_spaces.txt @@ -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. + } +} +```