3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

trimPluginDescription: use first line's indentation instead

This commit is contained in:
Dragory 2019-12-01 15:57:17 +02:00
parent 698174a584
commit 26c460e67a

View file

@ -53,8 +53,8 @@ export interface CommandInfo {
export function trimPluginDescription(str) {
const emptyLinesTrimmed = trimEmptyStartEndLines(str);
const lines = emptyLinesTrimmed.split("\n");
const lastLineIndentation = (lines[lines.length - 1].match(/^ +/g) || [""])[0].length;
return trimIndents(emptyLinesTrimmed, lastLineIndentation);
const firstLineIndentation = (lines[0].match(/^ +/g) || [""])[0].length;
return trimIndents(emptyLinesTrimmed, firstLineIndentation);
}
const inviteCache = new SimpleCache<Promise<Invite>>(10 * MINUTES, 200);