wechaty-web-panel 1.6.45 → 1.6.46
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.
package/CHANGELOG.md
CHANGED
|
@@ -502,10 +502,12 @@ exports.delHtmlTag = delHtmlTag;
|
|
|
502
502
|
* @returns {*[]}
|
|
503
503
|
*/
|
|
504
504
|
function extractImageLinks(text) {
|
|
505
|
-
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
506
|
-
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
505
|
+
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
506
|
+
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
507
507
|
const mdRegexHttps = /!\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
508
508
|
const mdRegexHttp = /!\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
509
|
+
const fileRegexHttp = /\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
510
|
+
const filesRegexHttp = /\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
509
511
|
let imageLinks = [];
|
|
510
512
|
let match;
|
|
511
513
|
while ((match = httpRegex.exec(text)) !== null) {
|
|
@@ -514,7 +516,7 @@ function extractImageLinks(text) {
|
|
|
514
516
|
while ((match = httpsRegex.exec(text)) !== null) {
|
|
515
517
|
imageLinks.push(match[0]);
|
|
516
518
|
}
|
|
517
|
-
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null) {
|
|
519
|
+
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null || (match = fileRegexHttp.exec(text)) !== null || (match = filesRegexHttp.exec(text)) !== null) {
|
|
518
520
|
imageLinks.push(match[1]);
|
|
519
521
|
}
|
|
520
522
|
imageLinks = Array.from(new Set(imageLinks));
|
|
@@ -451,10 +451,12 @@ export function delHtmlTag(str) {
|
|
|
451
451
|
* @returns {*[]}
|
|
452
452
|
*/
|
|
453
453
|
export function extractImageLinks(text) {
|
|
454
|
-
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
455
|
-
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar))/g;
|
|
454
|
+
const httpRegex = /(http:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
455
|
+
const httpsRegex = /(https:\/\/\S+\.(?:jpg|png|gif|webp|jpeg|mp4|doc|docx|xls|xlsx|ppt|pptx|avi|zip|wav|rar|pdf|txt|log))/g;
|
|
456
456
|
const mdRegexHttps = /!\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
457
457
|
const mdRegexHttp = /!\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
458
|
+
const fileRegexHttp = /\[[^\]]*\]\((http?:\/\/\S+)\)/g;
|
|
459
|
+
const filesRegexHttp = /\[[^\]]*\]\((https?:\/\/\S+)\)/g;
|
|
458
460
|
let imageLinks = [];
|
|
459
461
|
let match;
|
|
460
462
|
while ((match = httpRegex.exec(text)) !== null) {
|
|
@@ -463,7 +465,7 @@ export function extractImageLinks(text) {
|
|
|
463
465
|
while ((match = httpsRegex.exec(text)) !== null) {
|
|
464
466
|
imageLinks.push(match[0]);
|
|
465
467
|
}
|
|
466
|
-
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null) {
|
|
468
|
+
while ((match = mdRegexHttp.exec(text)) !== null || (match = mdRegexHttps.exec(text)) !== null || (match = fileRegexHttp.exec(text)) !== null || (match = filesRegexHttp.exec(text)) !== null) {
|
|
467
469
|
imageLinks.push(match[1]);
|
|
468
470
|
}
|
|
469
471
|
imageLinks = Array.from(new Set(imageLinks));
|