Could a newline not be considered a terminating character? Although that still wouldn’t resolve people leaving trailing @-mentions at the end of posts. (Although you could argue that such people are truly, truly awful
!)
The autocomplete fix sounds like it could work well, but I imagine it’d be a bit more complex under the hood.