This commit is contained in:
Matthew Hodgson 2018-05-20 23:43:42 +01:00
parent b616fd025e
commit 4439a04689
4 changed files with 13 additions and 22 deletions

View file

@ -132,8 +132,7 @@ export default class CommandProvider extends AutocompleteProvider {
let results;
if (command[0] == '/') {
results = COMMANDS;
}
else {
} else {
results = this.matcher.match(command[0]);
}
completions = results.map((result) => {

View file

@ -31,7 +31,7 @@ class PlainWithPillsSerializer {
* @param {String} options.pillFormat - either 'md', 'plain', 'id'
*/
constructor(options = {}) {
let {
const {
pillFormat = 'plain',
} = options;
this.pillFormat = pillFormat;
@ -46,7 +46,7 @@ class PlainWithPillsSerializer {
* @return {String}
*/
serialize = value => {
return this._serializeNode(value.document)
return this._serializeNode(value.document);
}
/**
@ -61,8 +61,7 @@ class PlainWithPillsSerializer {
(node.object == 'block' && Block.isBlockList(node.nodes))
) {
return node.nodes.map(this._serializeNode).join('\n');
}
else if (node.type == 'emoji') {
} else if (node.type == 'emoji') {
return node.data.get('emojiUnicode');
} else if (node.type == 'pill') {
switch (this.pillFormat) {
@ -73,11 +72,9 @@ class PlainWithPillsSerializer {
case 'id':
return node.data.get('completionId') || node.data.get('completion');
}
}
else if (node.nodes) {
} else if (node.nodes) {
return node.nodes.map(this._serializeNode).join('');
}
else {
} else {
return node.text;
}
}
@ -89,4 +86,4 @@ class PlainWithPillsSerializer {
* @type {PlainWithPillsSerializer}
*/
export default PlainWithPillsSerializer
export default PlainWithPillsSerializer;