Avoid using %tank %fats

Because tank printing is a pain. Rely instead on %text, using %name
to distinguish between intent.
This commit is contained in:
Fang 2019-08-02 22:41:39 +02:00
parent 9ce07b821f
commit ccf1e09a75
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 17 additions and 7 deletions

View File

@ -234,7 +234,7 @@ export class ChatInput extends Component {
} },
tac: { name: {
nom: 'long-form',
tac: { tank: lines.slice(1).map(l => { return {leaf: l }; }) }
tac: { text: lines.slice(1).join('\n') }
} },
} };
}

View File

@ -112,14 +112,24 @@ export class Message extends Component {
return (<details>
<summary className="inter fs-italic">{'Attached: ' + title}</summary>
{ _.has(content, 'text')
? <pre className="clamp-attachment">{content.text}</pre>
? (title === 'long-form')
? this.renderParagraphs(content.text.split('\n'))
: this.renderPlaintext(content.text)
: _.has(content, 'tank')
? <div className="clamp-attachment">
{content.tank.map(l => <p className="mt2">{l}</p>)}
</div>
: null
? this.renderPlaintext(content.tank.join('\n'))
: null
}
</>);
</details>);
}
renderParagraphs(paragraphs) {
return (<div className="clamp-attachment">
{paragraphs.map(p => (<p className="mt2">{p}</p>))}
</div>);
}
renderPlaintext(text) {
return (<pre className="clamp-attachment">{text}</pre>);
}
renderContent() {