Ensure Twitter @mentions are correctly formatted when posting TO Twitter
- Add an extra sample for twitter handles without a leading @ in the form username@twitter.com
- Update expected output in
test_double_mentionintests/test_toots.py - Refactor
test_twitter_mentionintests/test_toots.pyinto a shared helper method (_twitter_mention_helper) and two test methods; for testing mentions withSANITIZE_TWITTER_HANDLESenabled and disabled. - Move the replacement of
@user@twitter.commentions to the end ofsanitize_twitter_handlesinmoa/toot.py - Refactor the scan for overlapping @mentions between twitter handle matching and mastodon handle matching into sub function in
sanitize_twitter_handlesinmoa/toot.py - Update
sanitize_twitter_handlesand the new sub function inmoa/toot.pyto also handle fully-qualified Twitter @mentions (i.e. @user@twitter.com) to allow those to be passed through without rewriting until the end of the method where we then replace them with bare @mentions ready for posting to Twitter
Fixes: #40
Edited by Lucy Llewellyn