Showing results for 
Show  only  | Search instead for 
Did you mean: 

Remove Leading, Trailing, Extra Whitespace From All Form Fields

Remove Leading, Trailing, Extra Whitespace From All Form Fields

0 Kudos

If a user copy/pastes something and leaves extra whitespace (either leading, trailing, or duplicates), this can break things. All forms should have codes that checks for duplicate, trailing, or leading whitespace in an input field and removes it or ignores it before applying those changes/submitting the search query.


  • All users: RCE hyperlink button / Insert Link popup - Pasting a URL with leading or trailing whitespace causes a broken link. It's already being detected because it's replaced with a %20, but if it's in the first or last position it should just be trimmed instead.

  • All users: User account profile fields, like name - can break LTIs like Pearson MyLab and Mastering

  • Admin and instructor: Courses search field (and course search fields in other areas, such as cross-listing) - copy/pasting a course code or name very often includes trailing whitespace. (You double-click to highlight and copy, but it scoops up any trailing whitespace as well.) This causes the search results on the Admin Courses search and Cross-listing course search to come back empty, even when there's a matching course. (Might impact course copy search too; I haven't checked.)

  • Admin: Double whitespace between names - See this idea. Admin People search breaks when looking for "Aaron Ross" if the name was input as "Aaron  Ross" (with two spaces). We rely on name search to find out if someone has a Canvas account already or needs a new one.

Screenshots (click on one to make it bigger):

link error rce.pngpearson error code.pngaaron ross name search.png

Community Team
Community Team
Status changed to: Open
Community Member


Hi, I think you've made a really compelling case for Canvas to take this issue seriously.



Community Member

Commenting to add we just found out there's trailing whitespace in our root account name. 🤦‍

account name.png

And yes, it's causing LTI issues. I'm worried to change it now because I don't know whether it will affect the function of other LTIs. It would've been better if Canvas clipped the whitespace when we made the account.