msupply-foundation / conforma-web-app

Conforma application manager (IRIMS) front-end
GNU Affero General Public License v3.0
5 stars 0 forks source link

Strip extraneous white space from user input #1644

Open CarlosNZ opened 1 month ago

CarlosNZ commented 1 month ago

If users include white space at the end of their input, this can cause subsequent problems with Markdown rendering (e.g. wrapping in for italics).

So we should trim white space from all user input where possible. Places I can think of off the top of my head:

Also, might be a good idea to have a "keepWhiteSpace" property for form inputs, as we might want to allow only white space as a valid response in some situations

CarlosNZ commented 1 month ago

Need to also make sure this works for pre-filled elements (i.e. that have a default property)