diff --git a/src/extension.ts b/src/extension.ts index 03a12bc..39f98d6 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -50,6 +50,8 @@ const ANCHOR_MODE_LIST = "gitlab.com" ] +const EOL = require('os').EOL; + export function activate(context: ExtensionContext) { // create a MarkdownTocTools @@ -267,7 +269,10 @@ class MarkdownTocTools { let lineEnding = workspace.getConfiguration("files").get("eol"); let tabSize = workspace.getConfiguration("[markdown]")["editor.tabSize"]; let insertSpaces = workspace.getConfiguration("[markdown]")["editor.insertSpaces"]; - + + if (lineEnding === 'auto') { + lineEnding = EOL; + } if(tabSize === undefined || tabSize === null) { tabSize = workspace.getConfiguration("editor").get("tabSize"); }