fix @room
pill href=undefined and @room parsing breaking subsequent pills
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
b8ca65627b
commit
7c3873b449
2 changed files with 14 additions and 10 deletions
|
@ -64,13 +64,17 @@ class PlainWithPillsSerializer {
|
|||
} else if (node.type == 'emoji') {
|
||||
return node.data.get('emojiUnicode');
|
||||
} else if (node.type == 'pill') {
|
||||
const completion = node.data.get('completion');
|
||||
// over the wire the @room pill is just plaintext
|
||||
if (completion === '@room') return completion;
|
||||
|
||||
switch (this.pillFormat) {
|
||||
case 'plain':
|
||||
return node.data.get('completion');
|
||||
return completion;
|
||||
case 'md':
|
||||
return `[${ node.data.get('completion') }](${ node.data.get('href') })`;
|
||||
return `[${ completion }](${ node.data.get('href') })`;
|
||||
case 'id':
|
||||
return node.data.get('completionId') || node.data.get('completion');
|
||||
return node.data.get('completionId') || completion;
|
||||
}
|
||||
} else if (node.nodes) {
|
||||
return node.nodes.map(this._serializeNode).join('');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue