-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Only convert html links if they use http or https protocol (#459)
- Loading branch information
Showing
4 changed files
with
27 additions
and
1 deletion.
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
3 changes: 3 additions & 0 deletions
3
src/content/sync/html-to-notion/__tests__/fixtures/links.html
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,3 @@ | ||
<a href="https://notion.so">https link</a> | ||
<a href="http://notion.so">http link</a> | ||
<a href="zotero://select/item">zotero link</a> |
19 changes: 19 additions & 0 deletions
19
src/content/sync/html-to-notion/__tests__/fixtures/links.ts
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,19 @@ | ||
import { BlockObjectRequest } from '@notionhq/client/build/src/api-endpoints'; | ||
|
||
export const expected: BlockObjectRequest[] = [ | ||
{ | ||
paragraph: { | ||
rich_text: [ | ||
{ | ||
text: { content: 'https link', link: { url: 'https://notion.so/' } }, | ||
}, | ||
{ text: { content: ' ' } }, | ||
{ | ||
text: { content: 'http link', link: { url: 'http://notion.so/' } }, | ||
}, | ||
{ text: { content: ' ' } }, | ||
{ text: { content: 'zotero link' } }, | ||
], | ||
}, | ||
}, | ||
]; |
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