@seafile/sdoc-editor 1.0.206-test0.3.4 → 1.0.206-test0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,6 +71,20 @@ const parseVideoLink = url => {
71
71
  return videoUrl;
72
72
  }
73
73
 
74
+ // Bilibili url conversion
75
+ if (url.includes('bilibili.com')) {
76
+ const vidMatch = url.match(/\/video\/(BV[0-9A-Za-z]+)/);
77
+ const videoUrl = vidMatch !== null && vidMatch !== void 0 && vidMatch[1] ? `https://player.bilibili.com/player.html?bvid=${vidMatch[1]}` : false;
78
+ return videoUrl;
79
+ }
80
+
81
+ // Youku url conversion
82
+ if (url.includes('v.youku.com')) {
83
+ const vidMatch = url.match(/id_([A-Za-z0-9=]+)\.html/);
84
+ const videoUrl = vidMatch !== null && vidMatch !== void 0 && vidMatch[1] ? `https://player.youku.com/embed/${vidMatch[1]}` : false;
85
+ return videoUrl;
86
+ }
87
+
74
88
  // Unsupported url
75
89
  return false;
76
90
  };
@@ -83,7 +97,7 @@ const insertVideo = function (editor, videoFiles, srcList, selection) {
83
97
  if (isInsertVideoMenuDisabled(editor)) return;
84
98
  }
85
99
  let videoNodes;
86
- // Parse youtube and tencent video url when embed thirdPlatform link
100
+ // Parse youtube, tencent or bilibili video url when embed thirdPlatform link
87
101
  if (Array.isArray(videoFiles) && (_videoFiles$ = videoFiles[0]) !== null && _videoFiles$ !== void 0 && _videoFiles$.isEmbeddableLink) {
88
102
  const parsedSrc = parseVideoLink(srcList[0]);
89
103
  if (!parsedSrc) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.206-test0.3.4",
3
+ "version": "1.0.206-test0.3.5",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",