From b7d95f5368d16125aa929f4bd9986bd237ccf190 Mon Sep 17 00:00:00 2001 From: Domenico Rizzo Date: Fri, 28 Feb 2025 05:30:45 +0100 Subject: [PATCH] [MM-23180] Take full-width punctuation marks as boundary for hyperlinks (#30084) --- webapp/channels/package.json | 2 +- .../src/utils/markdown/link_only_renderer.test.tsx | 6 ++++++ webapp/package-lock.json | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/webapp/channels/package.json b/webapp/channels/package.json index a6872655e71..5c77165c366 100644 --- a/webapp/channels/package.json +++ b/webapp/channels/package.json @@ -52,7 +52,7 @@ "lodash": "4.17.21", "luxon": "3.3.0", "mark.js": "8.11.1", - "marked": "github:mattermost/marked#2ef7f28cc7718e3f551c4ce9ea75fdd7580c2008", + "marked": "github:mattermost/marked#3b13ba8ddf725327ddf0298361d6d304a021f2d1", "memoize-one": "6.0.0", "moment-timezone": "0.5.38", "p-queue": "7.3.0", diff --git a/webapp/channels/src/utils/markdown/link_only_renderer.test.tsx b/webapp/channels/src/utils/markdown/link_only_renderer.test.tsx index 63fa6139083..97a4926e264 100644 --- a/webapp/channels/src/utils/markdown/link_only_renderer.test.tsx +++ b/webapp/channels/src/utils/markdown/link_only_renderer.test.tsx @@ -283,6 +283,12 @@ describe('formatWithRenderer | LinkOnlyRenderer', () => { inputText: 'Let\'s try http://example/result?things={stuff}', outputText: 'Let's try http://example/result?things={stuff}', }, + { + description: 'link: link with a full-length punctuation', + inputText: 'Do you like https://mattermost.com/,這是第二個網址。?', + outputText: 'Do you like ' + + 'https://mattermost.com/,這是第二個網址。?', + }, ]; const linkOnlyRenderer = new LinkOnlyRenderer(); diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 5ee34c0ff2b..05df359783d 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -105,7 +105,7 @@ "lodash": "4.17.21", "luxon": "3.3.0", "mark.js": "8.11.1", - "marked": "github:mattermost/marked#2ef7f28cc7718e3f551c4ce9ea75fdd7580c2008", + "marked": "github:mattermost/marked#3b13ba8ddf725327ddf0298361d6d304a021f2d1", "memoize-one": "6.0.0", "moment-timezone": "0.5.38", "p-queue": "7.3.0", @@ -20696,8 +20696,9 @@ }, "node_modules/marked": { "version": "0.3.6", - "resolved": "git+ssh://git@github.com/mattermost/marked.git#2ef7f28cc7718e3f551c4ce9ea75fdd7580c2008", - "integrity": "sha512-RekZq9qAxIO1cl9Pircqp3iBxsEFklkqw5NTiBzgrwaK1JXhy/YYCIDpy31N1dbP3x9Hisw+obJy/QLigDY+Hg==", + "resolved": "git+ssh://git@github.com/mattermost/marked.git#3b13ba8ddf725327ddf0298361d6d304a021f2d1", + "integrity": "sha512-/G1/szBhwdamaCQQjdk+eKQKw4Xkmk8aQYxEQvIjfbcFHEaIgUbpH6RBSC+b0pDzlhm7mxHAaGnzfH3WqUks1Q==", + "license": "MIT", "bin": { "marked": "bin/marked" }