From 26c460e67a2632b034f0214847c178aaa48d551f Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 1 Dec 2019 15:57:17 +0200 Subject: [PATCH] trimPluginDescription: use first line's indentation instead --- backend/src/plugins/ZeppelinPlugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/plugins/ZeppelinPlugin.ts b/backend/src/plugins/ZeppelinPlugin.ts index f2cc6481..ce593a0b 100644 --- a/backend/src/plugins/ZeppelinPlugin.ts +++ b/backend/src/plugins/ZeppelinPlugin.ts @@ -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>(10 * MINUTES, 200);