From 5bfc7f00ecb596c37232c92f01f70c78dc31f0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Drago=C8=99=20Str=C4=83inu?= Date: Sat, 25 Apr 2020 13:44:05 +0300 Subject: [PATCH] fix: add comment for last link when position 'end' --- src/transform.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/transform.ts b/src/transform.ts index 582fc0a..87562a3 100644 --- a/src/transform.ts +++ b/src/transform.ts @@ -109,7 +109,9 @@ export function createNewFileContent( let newFileContent = fileContentByLine.join("\n"); if (!Number.isFinite(endHeaderIndex) && "end" === argv.position) { - newFileContent += `${LINK_OFFSET}[${linkText}](#${anchorSlug})\n`; + newFileContent += `${LINK_OFFSET}[${linkText}](#${anchorSlug})${ + argv.silent ? "" : LINK_COMMENT + }\n`; } return newFileContent;