mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
Closes: [BS-3291](https://linear.app/affine-design/issue/BS-3291/工具栏展开时报错,链接无法点击打开) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - URLs entered without a protocol (e.g., "github.com/...") are now automatically normalized to use "https://", ensuring links are secure and consistently formatted. - **Bug Fixes** - Improved handling and validation of links to prevent issues with missing or invalid protocols in bookmarks and inline links. - Simplified URL validation logic by leveraging native URL parsing, removing complex regex and email-specific checks. - Streamlined toolbar link actions to operate only on valid normalized URLs. - Refined URL detection in markdown preprocessing to exclude lines containing spaces from being treated as URLs. - **Tests** - Added tests to verify that links without a protocol are correctly normalized and displayed across different views. - Updated URL validation tests to better reflect valid and invalid URL formats, including IP addresses and domain variants. - **Style** - Updated snapshots to reflect the use of "https://" in links. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
65 lines
1.3 KiB
JSON
65 lines
1.3 KiB
JSON
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
{
|
|
"children": [
|
|
],
|
|
"flavour": "affine:paragraph",
|
|
"id": "2",
|
|
"props": {
|
|
"collapsed": false,
|
|
"text": {
|
|
"$blocksuite:internal:text$": true,
|
|
"delta": [
|
|
{
|
|
"attributes": {
|
|
"link": "https://affine.pro"
|
|
},
|
|
"insert": "aaa"
|
|
}
|
|
]
|
|
},
|
|
"type": "text"
|
|
},
|
|
"type": "block",
|
|
"version": 1
|
|
}
|
|
],
|
|
"flavour": "affine:note",
|
|
"id": "1",
|
|
"props": {
|
|
"background": {
|
|
"dark": "#252525",
|
|
"light": "#ffffff"
|
|
},
|
|
"displayMode": "both",
|
|
"edgeless": {
|
|
"style": {
|
|
"borderRadius": 8,
|
|
"borderSize": 4,
|
|
"borderStyle": "none",
|
|
"shadowType": "--affine-note-shadow-box"
|
|
}
|
|
},
|
|
"hidden": false,
|
|
"index": "a0",
|
|
"lockedBySelf": false,
|
|
"xywh": "[0,0,498,92]"
|
|
},
|
|
"type": "block",
|
|
"version": 1
|
|
}
|
|
],
|
|
"flavour": "affine:page",
|
|
"id": "0",
|
|
"props": {
|
|
"title": {
|
|
"$blocksuite:internal:text$": true,
|
|
"delta": [
|
|
]
|
|
}
|
|
},
|
|
"type": "block",
|
|
"version": 2
|
|
} |