WICG / sms-one-time-codes

A way to format SMS messages for use with browser autofill features such as HTML’s autocomplete=one-time-code.
https://wicg.github.io/sms-one-time-codes/
Other
110 stars 12 forks source link

Allowing multiple whitespace between host and code #9

Open majido opened 4 years ago

majido commented 4 years ago

IMHO the current parsing logic is a bit too strict when handling the space between host and code:

  1. It requires exactly one SPACE
  2. It requires SPACE and not a more general whitespace which includes TAB as well.

I suggest we relax these two requirements.

A secondary but somewhat related concern the parsing logic in some places uses ASCII whitespace and in some place uses SPACE. I think it would be much easier to have a single concept of white space that we use in the whole parsing algorithm.

This could be either:

samuelgoto commented 4 years ago

Seems reasonable to me. @hober WDYT?

context for @hober : this came up while code reviewing the implementation of the spec here.

majido commented 4 years ago

Sent a PR to at least make whitespace definition consistent in parsing.

https://github.com/WICG/sms-one-time-codes/pull/10