@lvce-editor/editor-worker 19.47.0 → 19.47.1
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/dist/editorWorkerMain.js +3 -2
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -3374,6 +3374,7 @@ const HAS_SCHEME_PATTERN = /^(?:https?|ftp|ftps|file):\/\//;
|
|
|
3374
3374
|
|
|
3375
3375
|
// Regex to check if URL starts with www.
|
|
3376
3376
|
const HAS_WWW_PATTERN = /^www\./;
|
|
3377
|
+
const TEMPLATE_EXPRESSION_START = '${';
|
|
3377
3378
|
const TRAILING_SENTENCE_PUNCTUATION = '.,;:!?';
|
|
3378
3379
|
const OPENING_DELIMITER_MAP = {
|
|
3379
3380
|
')': '(',
|
|
@@ -3423,8 +3424,8 @@ const detectLinks = text => {
|
|
|
3423
3424
|
const links = [];
|
|
3424
3425
|
for (const match of matches) {
|
|
3425
3426
|
const url = trimTrailingPunctuation(match[0]);
|
|
3426
|
-
// Only consider
|
|
3427
|
-
if (HAS_SCHEME_PATTERN.test(url) || HAS_WWW_PATTERN.test(url)) {
|
|
3427
|
+
// Only consider static links with a scheme or www prefix.
|
|
3428
|
+
if (!url.includes(TEMPLATE_EXPRESSION_START) && (HAS_SCHEME_PATTERN.test(url) || HAS_WWW_PATTERN.test(url))) {
|
|
3428
3429
|
links.push({
|
|
3429
3430
|
length: url.length,
|
|
3430
3431
|
start: match.index ?? 0
|