landscape: allow most patp punctation in tokenize
Fixes
@@ -52,13 +52,16 @@ const tokenizeMessage = (text) => {
}
messages.push({ url: str });
message = [];
- } else if(urbitOb.isValidPatp(str) && !isInCodeBlock) {
+ } else if (urbitOb.isValidPatp(str.replace(/[^a-z\-\~]/g, '')) && !isInCodeBlock) {
if (message.length > 0) {
// If we're in the middle of a message, add it to the stack and reset
messages.push({ text: message.join(' ') });
message = [];
}
- messages.push({ mention: str });
+ messages.push({ mention: str.replace(/[^a-z\-\~]/g, '') });
+ if (str.replace(/[a-z\-\~]/g, '').length > 0) {
+ messages.push({ text: str.replace(/[a-z\-\~]/g, '') });
+ }
message = [];
} else {
