Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Unified Diff: chrome/utility/importer/bookmark_html_reader.cc

Issue 22408007: Remove "<HR>" tags to import Firefox bookmarks correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revise as comments. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/utility/importer/bookmark_html_reader.cc
diff --git a/chrome/utility/importer/bookmark_html_reader.cc b/chrome/utility/importer/bookmark_html_reader.cc
index 5d34d7b191a817ce63ad6cf27df6cf68d6a56ce1..cb7b05048e3d456afec79ff1c9276ebd14667605 100644
--- a/chrome/utility/importer/bookmark_html_reader.cc
+++ b/chrome/utility/importer/bookmark_html_reader.cc
@@ -112,6 +112,15 @@ void ImportBookmarksFile(
std::string line;
TrimString(lines[i], " ", &line);
+ // Remove "<HR>" if |line| starts with it. "<HR>" is the bookmark entries
+ // separator in Firefox that Chrome does not support.
+ // See http://crbug.com/257474.
+ static const char kHrTag[] = "<HR>";
+ while (StartsWithASCII(line, kHrTag, false)) {
gab 2013/08/12 16:28:22 Just noticed this change to a while loop (and saw
zhchbin 2013/08/13 02:43:43 Done.
+ line.erase(0, arraysize(kHrTag) - 1);
+ TrimString(line, " ", &line);
+ }
+
// Get the encoding of the bookmark file.
if (internal::ParseCharsetFromLine(line, &charset))
continue;
« no previous file with comments | « chrome/test/data/bookmark_html_reader/firefox23.html ('k') | chrome/utility/importer/bookmark_html_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698