mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 10:02:32 +03:00
Support sending %exp messages
This commit is contained in:
parent
f463ae2839
commit
1ce3d5af7a
@ -116,7 +116,9 @@ export class ChatInput extends Component {
|
||||
}
|
||||
|
||||
getSpeechType(input) {
|
||||
if (input.indexOf('\n') >= 0) {
|
||||
if (input[0] === '#') {
|
||||
return 'exp';
|
||||
} else if (input.indexOf('\n') >= 0) {
|
||||
return 'fat';
|
||||
} else if (input[0] === '@') {
|
||||
return 'lin@';
|
||||
@ -133,6 +135,8 @@ export class ChatInput extends Component {
|
||||
return 'fs-italic';
|
||||
case 'url':
|
||||
return 'td-underline';
|
||||
case 'exp':
|
||||
return 'code';
|
||||
case 'fat':
|
||||
if (clipboard) return 'code';
|
||||
default:
|
||||
@ -198,6 +202,18 @@ export class ChatInput extends Component {
|
||||
case 'url':
|
||||
return this.globalizeUrl(content);
|
||||
//
|
||||
case 'exp':
|
||||
// remove leading #
|
||||
content = content.slice(1);
|
||||
// remove insignificant leading whitespace.
|
||||
// aces might be relevant to style.
|
||||
while (content[0] === '\n') {
|
||||
content = content.slice(1);
|
||||
}
|
||||
return { exp: {
|
||||
exp: content
|
||||
} };
|
||||
//
|
||||
case 'fat':
|
||||
// clipboard contents
|
||||
if (clipboard !== null) {
|
||||
|
Loading…
Reference in New Issue
Block a user