mzlogin / vim-markdown-toc

A vim 7.4+ plugin to generate table of contents for Markdown files.
http://www.vim.org/scripts/script.php?script_id=5460
MIT License
613 stars 59 forks source link

TOC links with non ascii characters #21

Closed 1978ajot closed 7 years ago

1978ajot commented 7 years ago

I'm using pandoc to convert my markdown files to HTML format. When using :GenTocRedcarpet command, generated TOC links looks like: [Wstępna konfiguracja karty](#wstępna-konfiguracja-karty)

Pandoc creates <h> tags that looks like: <h2 id="wstepna-konfiguracja-karty">Wstępna konfiguracja karty</h2>

As you see, there are no letters other than ascii characters inside id attribute.

Is it possible to to pass link part of TOC through command like iconv -t ascii//TRANSLIT, so letters like ę, ą, ś will be replaced by e, a, s?

Regards,

Andrzej.

mzlogin commented 7 years ago

https://github.com/jgm/pandoc/wiki/Pandoc-Tricks#toc-generation

This may helpful to solve your problem, use Pandoc's feature to get your goal achieve may better solution.

1978ajot commented 7 years ago

Thank you for your advice. That's not exactly what I need, but with a little bit of scripting it is quite usable solution for me.