finos / messageml-utils

MessageML is a markup language used by the Symphony Agent API for representing messages, including formatting (bold, italic, numbered and unnumbered lists etc.) and entity data representing structured objects.
https://docs.developers.symphony.com
Apache License 2.0
12 stars 28 forks source link

Relax keyword verification rules #76

Closed ldrozdz closed 5 years ago

ldrozdz commented 5 years ago

The rules for validating keyword content are currently limited to alphanumeric characters, dash and underscore. Relax them to match the behaviour of the Symphony client:

const hashtagValidator = /[\S]*[^\s!@#$%^&*()+=<>,./?`~:;'"\\|-]+[\S]*$/;
const cashtagValidator = /^(?!(?:[0-9,.]+$))(?!(?:[0-9,.]+(m|b|t|mm|bn|M|B|T|MM|BN|\+|\-|\)|\(|\[|\]|\*|\/)(\s|$)))[^\s\$]*[^\s!@#$%^&*()+=<>,.\/?`~:;'"\\|\-]+[^\s\$]*$/;

Note: in the future, we should offer full Unicode support for keyword values.

ldrozdz commented 5 years ago

Fixed in https://github.com/symphonyoss/messageml-utils/commit/22f0cba5192cdf1cbbc0b28c888666130ac562bb