diff --git a/root/static/scripts/edit/URLCleanup.js b/root/static/scripts/edit/URLCleanup.js index 914c9236989..f4793928049 100644 --- a/root/static/scripts/edit/URLCleanup.js +++ b/root/static/scripts/edit/URLCleanup.js @@ -4464,6 +4464,10 @@ const CLEANUPS: CleanupEntries = { /^(?:https?:\/\/)?(?:(?:www|mobile)\.)?twitter\.com(?:\/#!)?\//, 'https://twitter.com/', ); + url = url.replace( + /^(https:\/\/twitter\.com)\/intent\/user\/?\?screen_name=([^\/?#]+)/, + '$1/$2', + ); url = url.replace( /^(https:\/\/twitter\.com)\/@?([^\/?#]+(?:\/status\/\d+)?)(?:[\/?#].*)?$/, '$1/$2', diff --git a/root/static/scripts/tests/Control/URLCleanup.js b/root/static/scripts/tests/Control/URLCleanup.js index d3be581124d..8c302657334 100644 --- a/root/static/scripts/tests/Control/URLCleanup.js +++ b/root/static/scripts/tests/Control/URLCleanup.js @@ -4650,6 +4650,18 @@ limited_link_type_combinations: [ expected_relationship_type: 'socialnetwork', expected_clean_url: 'https://twitter.com/cirrhaniva', }, + { + input_url: 'https://mobile.twitter.com/intent/user?screen_name=emily_doolittle', + input_entity_type: 'artist', + expected_relationship_type: 'socialnetwork', + expected_clean_url: 'https://twitter.com/emily_doolittle', + }, + { + input_url: 'https://mobile.twitter.com/intent/user/?screen_name=emily_doolittle', + input_entity_type: 'artist', + expected_relationship_type: 'socialnetwork', + expected_clean_url: 'https://twitter.com/emily_doolittle', + }, { input_url: 'https://twitter.com/@UNIVERSAL_D', input_entity_type: 'label',