diff --git a/README.md b/README.md index 7c30e73..73d1350 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ code With options: ```` ->[options]```lang +>options```lang code ``` ```` @@ -29,7 +29,7 @@ code With options: ```` ->[options]`lang code` +>options`lang code` ```` ### Examples @@ -42,7 +42,7 @@ main = print 1 ```` ```` ->[harmony]```js +>harmony```js class Foo { bar = 1; } @@ -55,6 +55,10 @@ console.log(new Foo().bar); >`py print('hello world')` ``` +``` +>e`hs (+) <$> Just 1 <*> Just 2` +``` + ## Supported Languages One of the following languages is set in `lang`. diff --git a/src/commands/help.js b/src/commands/help.js index 02d7955..d3ad1ce 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -12,7 +12,7 @@ class HelpCommand extends Command { return message.util.send([ '**Usage:**', 'Put a `>` before a code block with a language or an inline code block that has a language to execute it.', - 'You can add options inside `[]` after the `>`.', + 'You can add options, separated by semicolons, after the `>`.', '', '**Examples:**', '```', @@ -22,9 +22,9 @@ class HelpCommand extends Command { '', '>`hs main = print (1 + 1)`', '', - '>[harmony]`\u200B``js', + '>e; harmony`\u200B``js', 'class Foo { bar = 1; }', - 'console.log(new Foo().bar);', + 'new Foo().bar;', '`\u200B``', '```', '**Supported languages:**', diff --git a/src/listeners/messageInvalid.js b/src/listeners/messageInvalid.js index 306c6bd..ac832f8 100644 --- a/src/listeners/messageInvalid.js +++ b/src/listeners/messageInvalid.js @@ -37,8 +37,8 @@ class MessageInvalidListener extends Listener { } parseMessage(message) { - const regex1 = /^\s*>\s*(?:\[(.+?)\])?\s*```(.+?)\n([^]+)```\s*$/; - const regex2 = /^\s*>\s*(?:\[(.+?)\])?\s*`(.+?) \s*([^]+)`\s*$/; + const regex1 = /^\s*>\s*(?:(.+?))?\s*```(.+?)\n([^]+)```\s*$/; + const regex2 = /^\s*>\s*(?:(.+?))?\s*`(.+?) \s*([^]+)`\s*$/; const match = message.content.match(regex1) || message.content.match(regex2); if (!match) { return null;