alanwalk / markdown-toc

MarkdownTOC(Table Of Contents) Plugin for Visual Studio Code.
MIT License
141 stars 111 forks source link

No html markup is generated #15

Closed oceanho closed 7 years ago

oceanho commented 7 years ago

Hi . I'm generated TOC by markdown-toc . It's so cool . I encountered a little problem . The TOC's links can not work . Html tag is not generated plot points .

Here is my code

# 1. TOC test

<!-- TOC -->

- [1. TOC test](#1-toc-test)
    - [1.1. Title 1](#11-title-1)
    - [1.2. Title 2](#12-title-2)
    - [1.3. Title 3](#13-title-3)
    - [1.4. Title 4](#14-title-4)

<!-- /TOC -->

## 1.1. Title 1

There is title 1,Click TOC's Title 1 does not go to here

## 1.2. Title 2

There is title 2,Click TOC's Title 2 does not go to here

## 1.3. Title 3

There is title 3,Click TOC's Title 3 does not go to here

## 1.4. Title 4

There is title 4,Click TOC's Title 4 does not go to here

Can you give some ideas ? Thanks

alanwalk commented 7 years ago

你的markdown预览平台是什么,对于github、gitlab或者其他的平台会有不同的锚链接生成语法。

oceanho commented 7 years ago

通过 Visual Studio Code 插件 vscode-instant-markdown 预览的。 提交到 git.oschina.net 上,链接也出不来。好像只能用Html方式写了(除非平台提供其它支持方案)

alanwalk commented 7 years ago

Hi,不好意思,最近有点忙回的有点晚了。

这两天看了下,没有找到 git.oschina.net 的Markdown锚链接生成文档,所以没办法很好的生成匹配规则的锚标记。

目前来看你只能用HTML的方式写了。插件里有一键插入HTML链接的配置,配一下全局Setting或者在单个文档的TOC中加入 insertAnchor:true

<a id="markdown-1-toc-test" name="1-toc-test"></a>
# 1. TOC test

<!-- TOC insertAnchor:true -->

- [1. TOC test](#1-toc-test)
    - [1.1. Title 1](#11-title-1)
    - [1.2. Title 2](#12-title-2)
    - [1.3. Title 3](#13-title-3)
    - [1.4. Title 4](#14-title-4)

<!-- /TOC -->

<a id="markdown-11-title-1" name="11-title-1"></a>
## 1.1. Title 1

There is title 1,Click TOC's Title 1 does not go to here

<a id="markdown-12-title-2" name="12-title-2"></a>
## 1.2. Title 2

There is title 2,Click TOC's Title 2 does not go to here

<a id="markdown-13-title-3" name="13-title-3"></a>
## 1.3. Title 3

There is title 3,Click TOC's Title 3 does not go to here

<a id="markdown-14-title-4" name="14-title-4"></a>
## 1.4. Title 4

There is title 4,Click TOC's Title 4 does not go to here
oceanho commented 7 years ago

我在 Visual Studio Code 里面看到更新了,亲测已经可用,辛苦了.谢谢. 我先把这个Issue在这里关闭了,后期若找到markdown生成html描的生成方法,再补到issue后面. 最后,再次谢谢. :handshake: