medfreeman / markdown-it-toc-and-anchor

markdown-it plugin to add a toc and anchor links in headings
MIT License
60 stars 35 forks source link

Compatibility with target=_blank rules/plugins #37

Closed xhh2a closed 7 years ago

xhh2a commented 7 years ago

I'm trying to get a target=_blank markdown plugin to work along with this plugin. I noticed some issues:

1) The anchor tokens generated by this is are not Token instances. This means I have to do a try {} catch {} around the code that is based off of https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer

2) When I get type=link_open Tokens for the TOC generated parts they don't have any identifiers that they were generated by this plugin. It would be good to also apply the className to the links themselves in addition to the ul divs.

xhh2a commented 7 years ago

Nvm I wrote my own fork of the blank to work with toc.