MM-62744 Change how custom URLs are autolinked to fix remote user at-mentions (#32080)
* Stop explicitly passing autocompleteUrlSchemes into text formatting code This is the first part of changing how autocompleteUrlSchemes works so that it can be moved to be part of the parser like in mobile instead of happening in the renderer. I'm not a fan of using the global store directly in utils/markdown, but this seems like the only way to have this apply to all the Markdown that's rendered in various helpers throughout the app. Ideally, we'd have some getMarkdownParser selector and a hook which provides the config, but that's a future improvement to make" * MM-62744 Move URL filtering to the Markdown parser instead of the renderer MM-62744 is caused by two things: 1. URL autolinking takes place in the Markdown parser which occurs before at-mention parsing which (despite the "parsing" part) happens in the Markdown renderer in the web app. 2. The autolinking in marked is very aggressive and identifies anything that looks like some:text as a link. Those lead to remote mentions like `@user:server` being incorrectly parsed by Markdown as a link to `user:server`. It isn't renderered as a link because the URL filtering logic in the Markdown parser blocks that, but at that point, the Markdown renderer won't check if it's an at-mention. By moving the URL filtering to occur earlier, like it does in the mobile app, the Markdown code won't autolink `@user:server` (unless the server has `user` configured as a custom URL scheme for some reason), so it's free to be turned into an at-mention by the renderer code. * MM-62744 Ensure various regexes and features support remote mentions * Update marked back to master
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0d4c2b72f1
Коммит
5b6320b7dc
6
webapp/package-lock.json
сгенерированный
6
webapp/package-lock.json
сгенерированный
@@ -105,7 +105,7 @@
|
||||
"lodash": "4.17.21",
|
||||
"luxon": "3.6.1",
|
||||
"mark.js": "8.11.1",
|
||||
"marked": "github:mattermost/marked#3b13ba8ddf725327ddf0298361d6d304a021f2d1",
|
||||
"marked": "github:mattermost/marked#08f3638e37e17738fafcaf749683ce6fee1d8edc",
|
||||
"memoize-one": "6.0.0",
|
||||
"moment-timezone": "0.5.38",
|
||||
"monaco-editor": "0.52.2",
|
||||
@@ -20662,8 +20662,8 @@
|
||||
},
|
||||
"node_modules/marked": {
|
||||
"version": "0.3.6",
|
||||
"resolved": "git+ssh://git@github.com/mattermost/marked.git#3b13ba8ddf725327ddf0298361d6d304a021f2d1",
|
||||
"integrity": "sha512-/G1/szBhwdamaCQQjdk+eKQKw4Xkmk8aQYxEQvIjfbcFHEaIgUbpH6RBSC+b0pDzlhm7mxHAaGnzfH3WqUks1Q==",
|
||||
"resolved": "git+ssh://git@github.com/mattermost/marked.git#08f3638e37e17738fafcaf749683ce6fee1d8edc",
|
||||
"integrity": "sha512-zaU3iMz9BuvdYUjAF4zL0ioAstBgFI+xUgO5BNaEDGI+cXoXcRa5X2Bq0uA7Xn6NSQi0X04Xn5EuH+pxhvIllQ==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"marked": "bin/marked"
|
||||
|
||||
Ссылка в новой задаче
Block a user