Commit Graph

54 Commits (3d41b48543f9367b8d7523ebe0d5f0e417787988)

Author SHA1 Message Date
J. Ryan Stinnett 5d78418530 Recognise *.element.io links as Element permalinks
This ensures all Elements detect permalinks to official deployments as Element
and handle them internally.

Fixes https://github.com/vector-im/element-web/issues/16005
2020-12-21 13:15:00 +00:00
J. Ryan Stinnett 162a5de82e Rename and reformat Element URL pattern
This is just a code style cleanup. There are no behaviour changes in this
commit.
2020-12-21 13:05:45 +00:00
Michael Telatynski edba204408 accept and linkify local domains like those from mDNS
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-05-14 13:04:30 +01:00
David Baker 9c20bf22ce Fix soft-crash on bad permalinks
Fixes https://github.com/vector-im/riot-web/issues/12880
2020-03-26 10:45:26 +00:00
Michael Telatynski 61a9dd0ee3 delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-03-20 00:56:41 +00:00
Michael Telatynski 2fcca5d4e4 Handle matrix.to user permalink in-room rather than solo
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-03-20 00:42:44 +00:00
Travis Ralston d820356990 Convert alias links in room header topics to local permalinks
Fixes https://github.com/vector-im/riot-web/issues/12605
2020-03-04 13:56:58 -07:00
Michael Telatynski d783ce86c8 Use noreferrer in addition to noopener for edge case browsers
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-02-23 22:14:29 +00:00
N-Pex d403ed7513 Fix linkify imports
VECTOR_URL_PATTERN was 'undefined' inside Permalinks.tryTransformPermalinkToLocalHref()
2019-11-06 10:41:14 +01:00
Travis Ralston 6b09c3e9e6 Appease the linter 2019-09-30 21:03:16 -06:00
Travis Ralston fc66e69c02 Rename RoomPermalinkCreator -> Permalinks due to scope
The file handles more than just a RoomPermalinkCreator, so we should name it accordingly.
2019-09-30 20:39:58 -06:00
Travis Ralston 2cb0b4903a Converge on permalink processing for HtmlUtils and linkify-matrix 2019-09-30 20:17:54 -06:00
Travis Ralston 926e1146f9 Move spec permalinks into their own class
This allows for Riot permalinks to be introduced without if-else ladders everywhere.
2019-09-30 12:51:17 -06:00
Travis Ralston f9d5e89017 Move early parts of matrix.to bits into its own class 2019-09-30 12:37:13 -06:00
Travis Ralston 64aa6695f5 Move matrix-to.js to utils/permalinks/RoomPermalinkCreator
Just a little bit of refactoring to make the feature of custom prefixes a bit easier.
2019-09-30 12:16:46 -06:00
Michael Telatynski e502558f7d Delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-09-18 09:27:43 +01:00
Michael Telatynski 96163d1402
prevent multiple ports (🔢1234:1234)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-26 23:41:46 +01:00
Michael Telatynski 9f3a121abc
optimize linkify-matrix by skipping an intermediary state
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-26 23:36:01 +01:00
Michael Telatynski 09b09846cf
allow `:port` specifiers in roomalias,groupid and userid as per spec
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-26 23:33:35 +01:00
Michael Telatynski 1d2945036f
allow TLD to come anywhere in the domain, because `com` isn't JUST a TLD
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-23 19:42:03 +01:00
Michael Telatynski 2d11d6dcc0
accept repeated TLDs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-23 19:29:26 +01:00
Luke Barnard d6f0f77561 Fix MATRIXTO_URL_PATTERN RegExp groups
Fixes https://github.com/vector-im/riot-web/issues/6900
Fixes https://github.com/vector-im/riot-web/issues/6899
2018-06-18 17:46:22 +01:00
Michael Telatynski 4f693a1ff5
implement group links in matrixLinkify:MATRIXTO. Simplify if/else w/ map
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-16 08:27:17 +01:00
Michael Telatynski 0f85391587
Implement Rich Quoting/Replies
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-10 12:50:41 +00:00
Luke Barnard d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Luke Barnard e8495f637f Strip MD mentions from the `body` of sent messages
Because previously we just sent the display name and MD links are not very readable.
2017-07-21 16:38:31 +01:00
David Baker 87fac367ac quote consistency 2017-06-27 13:37:59 +01:00
Erik Johnston 998a55a590 Add basic group view 2017-06-05 17:10:08 +01:00
Matthew Hodgson 6a63c7e50c fix deep-linking to riot.im/app 2017-04-22 21:06:38 +01:00
Matthew Hodgson 5de71ef504 unbreak in-app permalinks correctly 2017-04-10 12:07:39 +01:00
Matthew Hodgson 2a4b052fa5 unbreak in-app permalinks 2017-04-10 12:06:54 +01:00
David Baker 18d4d3392a Fix a bunch of linting errors
eslint --fix and a few manual ones
2017-01-20 14:22:27 +00:00
David Baker 04c27205a3 Make room alias & user ID links matrix.to links 2016-11-04 11:38:28 +00:00
David Baker 0448dca832 Fail hard & fast if linkifyjs version is wrong
Rather than carrying on an ending up with undefineds deep within the bowels of linkifyjs when we try to linkify a room alias.
2016-09-27 10:38:01 +01:00
David Baker 2120963c7a More linkifier fixes
* Accept underscores in usernames
 * Accept usernames & room aliases on localhost
 * Accept #localhost:foo.com and @localhost:foo.com
2016-09-23 14:02:14 +01:00
David Baker 59117f1905 Fix linkifying rooms with underscores, try 2
Fixes https://github.com/vector-im/vector-web/issues/500
2016-09-21 14:11:43 +01:00
Matthew Hodgson ee672d06de Revert "Fix linkification and bump linkifyjs dep" 2016-09-13 19:36:46 +01:00
Aviral Dasgupta 8db2a4d46f Fix linkification and bump linkifyjs dep 2016-09-12 03:30:00 +05:30
Matthew Hodgson 18436e1257 pick up ! matrix.to URLs 2016-08-28 02:12:18 +01:00
Matthew Hodgson de82ac3bc0 don't change URL bar when clicking on linkified rooms or users.
be aware of /user paths.
2016-08-28 02:05:31 +01:00
Matthew Hodgson ad873c2b60 handle matrix.to links correctly. add partial support for #/user URLs 2016-08-28 01:55:42 +01:00
Matthew Hodgson 2a3b0e85ea add rel='noopener' wherever we do target='_blank' because https://mathiasbynens.github.io/rel-noopener/ 2016-08-15 21:37:26 +01:00
Matthew Hodgson c3e96f8af1 incorporate review 2016-03-21 15:45:04 +00:00
Matthew Hodgson d54a75c913 actually, only intercept URLs which are explicitly referring to our current app 2016-03-20 12:31:30 +00:00
Matthew Hodgson 1aed9ccbf4 linkify vector.im URLs directly into the app, both from HTML and non-HTML messages 2016-03-20 03:05:07 +00:00
David Baker aef04d682b Make the links we emit for room URLs valid rather than relying on the onClick handler (ie. make them work if you c+p them) 2016-02-18 18:16:39 +00:00
Matthew Hodgson 0772f50fab update copyright for 2016 2016-01-07 04:06:52 +00:00
Kegan Dougal 77d1b9af04 Hook up aliases via listeners too. 2015-10-27 09:58:55 +00:00
Kegan Dougal 24ac801417 Invoke onUserClick to allow impls to do whatever on user clicks. 2015-10-26 17:59:49 +00:00
Kegan Dougal 11ef1ac336 Prevent the url from being butchered when clicking user IDs 2015-10-26 17:36:03 +00:00