We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7857918 commit 4e19054Copy full SHA for 4e19054
bot.js
@@ -112,10 +112,11 @@ function logMessage(message, edit)
112
// return an array of all the code blocks contained in a string
113
function getCodeBlocks(string)
114
{
115
- // how to make it only collect whats in ( and ) ?
116
- // so we don't have to explicitely chop off the code block delimiters?
117
const regex = /\`\`\`([a-z]*[\s\S]*?)\`\`\`/g;
118
- return (string.match(regex) || []).map(s => s.slice(3, -3));
+ const result = [];
+ var matches;
+ while((matches = regex.exec(string)) !== null) result.push(matches[1]);
119
+ return result;
120
}
121
122
// return an array of links of some domain in a string
0 commit comments