diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 36bd66c8ec..5fc13f51bd 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -2738,7 +2738,6 @@ B662D3DE275613BB0035D4D6 /* EncryptionKeyStoreMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B662D3DD275613BB0035D4D6 /* EncryptionKeyStoreMock.swift */; }; B662D3DF275616FF0035D4D6 /* EncryptionKeyStoreMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B662D3DD275613BB0035D4D6 /* EncryptionKeyStoreMock.swift */; }; B6656E122B29E3BE008798A1 /* DownloadListStoreMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B693956026F1C1BC0015B914 /* DownloadListStoreMock.swift */; }; - B6656E5B2B2ADB1C008798A1 /* RequestFilePermissionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6B5F5832B03580A008DB58A /* RequestFilePermissionView.swift */; }; B6676BE12AA986A700525A21 /* AddressBarTextEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6676BE02AA986A700525A21 /* AddressBarTextEditor.swift */; }; B6676BE22AA986A700525A21 /* AddressBarTextEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6676BE02AA986A700525A21 /* AddressBarTextEditor.swift */; }; B6685E3D29A602D90043D2EE /* ExternalAppSchemeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = B687B7CB2947A1E9001DEA6F /* ExternalAppSchemeHandler.swift */; }; @@ -3042,13 +3041,6 @@ remoteGlobalIDString = AA585D7D248FD31100E9A3E2; remoteInfo = "DuckDuckGo Privacy Browser"; }; - 565E46E32B2725DD0013AC2A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = AA585D76248FD31100E9A3E2 /* Project object */; - proxyType = 1; - remoteGlobalIDString = AA585D7D248FD31100E9A3E2; - remoteInfo = "DuckDuckGo Privacy Browser"; - }; 7B4CE8DF26F02108009134B1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = AA585D76248FD31100E9A3E2 /* Project object */; @@ -4070,6 +4062,7 @@ B657841925FA484B00D8DB33 /* NSException+Catch.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSException+Catch.m"; sourceTree = ""; }; B657841E25FA497600D8DB33 /* NSException+Catch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSException+Catch.swift"; sourceTree = ""; }; B65CD8D42B316FCA00A595BB /* __Snapshots__ */ = {isa = PBXFileReference; lastKnownFileType = folder; path = __Snapshots__; sourceTree = ""; }; + B65CD8D72B341FD300A595BB /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; B65E6B9D26D9EC0800095F96 /* CircularProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircularProgressView.swift; sourceTree = ""; }; B65E6B9F26D9F10600095F96 /* NSBezierPathExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSBezierPathExtension.swift; sourceTree = ""; }; B66260DC29AC5D4300E9E3EE /* NavigationProtectionTabExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationProtectionTabExtension.swift; sourceTree = ""; }; @@ -4722,6 +4715,7 @@ 373A1AA6283ECC8000586521 /* HTML */ = { isa = PBXGroup; children = ( + B65CD8D72B341FD300A595BB /* README.md */, 373A1AA7283ED1B900586521 /* BookmarkHTMLReader.swift */, 373A1AAF2842C4EA00586521 /* BookmarkHTMLImporter.swift */, ); @@ -8287,7 +8281,6 @@ buildRules = ( ); dependencies = ( - 565E46E42B2725DD0013AC2A /* PBXTargetDependency */, ); name = SyncE2EUITests; productName = DuckDuckGoSyncUITests; diff --git a/DuckDuckGo/DataImport/Bookmarks/HTML/BookmarkHTMLReader.swift b/DuckDuckGo/DataImport/Bookmarks/HTML/BookmarkHTMLReader.swift index baf4a757ca..31dbf918f7 100644 --- a/DuckDuckGo/DataImport/Bookmarks/HTML/BookmarkHTMLReader.swift +++ b/DuckDuckGo/DataImport/Bookmarks/HTML/BookmarkHTMLReader.swift @@ -26,14 +26,13 @@ struct HTMLImportedBookmarks { final class BookmarkHTMLReader { struct ImportError: DataImportError { + // !! do not change the order + // cases 2,3 and 6 are reserved for removed errors enum OperationType: Int { case parseXml = 0 case validationBody = 1 - // case validationH1 - // case findTopLevelFolder case proceedToTopLevelFolder = 4 case readFolder = 5 - // case bookmarkRead case unknown = 7 } diff --git a/DuckDuckGo/DataImport/Bookmarks/HTML/README.md b/DuckDuckGo/DataImport/Bookmarks/HTML/README.md index a44dbc4a4a..a8944c84e6 100644 --- a/DuckDuckGo/DataImport/Bookmarks/HTML/README.md +++ b/DuckDuckGo/DataImport/Bookmarks/HTML/README.md @@ -4,15 +4,24 @@ ```mermaid graph TD - A[cursor = document root node] -->|validateHTMLBookmarksDocument| B[cursor = h1 tag] + A[cursor = document root node] -->|validateHTMLBookmarksDocument| B[cursor = first body child] B --> C[determineImportSource
findTopLevelFolderNameNode] - C --> D[cursor => nextSibling] + C --> D{cursor.htmlTag} D -->|`dl` tag| E[proceedToTopLevel
FolderNameNode] - E --> F[store cursor
cursor => firstChild] - F -->|`dd` tag| G[cursor => firstChild] + E --> E1[store cursor
cursor => firstChild] + E1 --> F{cursor.htmlTag} + F -->|`dd` tag| F1[cursor => firstChild] + F1 --> G{cursor.htmlTag} G -->|`h3` tag| H[cursor = top level folder name
source = other] + G -->|other tag| G1[cursor => nextSibling] + G -->|`nil`| RET + G1 --> F F -->|`dt` tag| I[restore cursor
no top level folder] + F -->|other tag| ERR D -->|`h3` tag| J{isDDGBookmarks?} + D -->|other tag| NXT[cursor => nextSibling] + NXT --> D + D -->|`nil`| RET I --> K{isDDGBookmarks?} K -->|no| L[cursor = first item in folder
source = Safari] K -->|yes| M[cursor = first item in folder
source = DDG WebKit]