-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoder+decoder: escape/unescape HTML characters in bookmark descript…
…ions Signed-off-by: VirtualTam <[email protected]>
- Loading branch information
1 parent
3623544
commit 5fe95e9
Showing
4 changed files
with
73 additions
and
2 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 |
---|---|---|
|
@@ -283,6 +283,50 @@ func TestDecodeBookmark(t *testing.T) { | |
Description: "Nested lists:\n- list1\n - item1.1\n - item1.2\n - item1.3\n- list2\n - item2.1", | ||
}, | ||
}, | ||
{ | ||
tname: "bookmark with description containing escaped HTML characters", | ||
input: BookmarkNode{ | ||
Description: ""Fran & Freddie's Diner" <[email protected]>", | ||
Href: "https://domain.tld", | ||
Title: "Test Domain", | ||
}, | ||
want: Bookmark{ | ||
Title: "Test Domain", | ||
URL: "https://domain.tld", | ||
Description: `"Fran & Freddie's Diner" <[email protected]>`, | ||
}, | ||
}, | ||
{ | ||
tname: "bookmark with multi-line description containing escaped HTML characters", | ||
input: BookmarkNode{ | ||
Description: ` | ||
> The format of here-documents is: | ||
` + "```shell" + ` | ||
[n]<<[-]word | ||
here-document | ||
delimiter | ||
` + "```" + ` | ||
> If any part of word is quoted, the delimiter is the result of quote removal on word, and the lines in the here-document are not expanded.`, | ||
Href: "https://domain.tld", | ||
Title: "Test Domain", | ||
}, | ||
want: Bookmark{ | ||
Title: "Test Domain", | ||
URL: "https://domain.tld", | ||
Description: ` | ||
> The format of here-documents is: | ||
` + "```shell" + ` | ||
[n]<<[-]word | ||
here-document | ||
delimiter | ||
` + "```" + ` | ||
> If any part of word is quoted, the delimiter is the result of quote removal on word, and the lines in the here-document are not expanded.`, | ||
}, | ||
}, | ||
{ | ||
tname: "bookmark with creation date", | ||
input: BookmarkNode{ | ||
|
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