-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersmarkdownMarkdown support issuesMarkdown support issuesverifiedVerification succeededVerification succeeded
Milestone
Description
Version: 1.47.2 (system setup)
Commit: 17299e4
Date: 2020-07-15T18:22:06.216Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
Steps to Reproduce:
- I have a markdown file with a ToC of it. Basically it looks like:
## Table of Content
- [Introduction](#introduction)
## Introduction
....- I'm using 'markdown.api.render' command to render the markdown string to html string, something like this:
let markdownString: string = await fse.readFile(markdownFilePath, 'utf8');
const html = await commands.executeCommand('markdown.api.render', markdownString);- I found out that, start from the second time calling this command, the ToC won't work anymore. After checking the generated html string, I found that the
idfor theIntroductionwill appended by a number:
<ul>
<li data-line="3" class="code-line"><a href="#introduction" data-href="#introduction" title="#introduction">Introduction</a></li>
</ul>
...
<h2 id="introduction-1" data-line="32" class="code-line">Introduction</h2>Is this expected? And what's the suggested way to use this command to render the same markdown string multiple time?
Thanks.
Does this issue occur when all extensions are disabled?: Yes/No
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersmarkdownMarkdown support issuesMarkdown support issuesverifiedVerification succeededVerification succeeded