Code Monkey home page Code Monkey logo

Comments (12)

bdgong avatar bdgong commented on May 16, 2024

Already have a similar issue, I should close it.

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 16, 2024

Yes, please ref #6 (comment)

from vim-markdown-toc.

bdgong avatar bdgong commented on May 16, 2024

I change to iamcco/markdown-preview, now I can navigate between level 2 headers '##', but not lower headers, like '###'.

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 16, 2024

I just test for it, in my environment I can navigate between level 2/3/4/5... headers well. Could you provide a markdown content snippets to reproduce your problem?

ps: iamcco/markdown-preview use https://github.com/markedjs/marked as its Markdown Parser, the support for it has not been tested. I guess the reason is there are some symbols in your header, and different markdown parsers generate different anchor links for a same header.

from vim-markdown-toc.

bdgong avatar bdgong commented on May 16, 2024

https://gitee.com/bdgong/tech-notes/blob/master/book/note__JavaConcurrencyInPractice.md

So, how could I see the anchor the Parser generated? or, I can not

from vim-markdown-toc.

bdgong avatar bdgong commented on May 16, 2024

Anyway, which vim plugin you use to preview markdown?

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 16, 2024

image

Just use Chrome devtools, the id value is anchor.

anchors generated for header 2.4 Guarding State with Locks:

  • iamcco/markdown-preview: 2.4-guarding-state-with-locks

  • gitee: 24-guarding-state-with-locks

  • Redcarpet: 2-4-guarding-state-with-locks

They all different from others. So I give up to find a tool which can preview markdown with toc links are right. I just confirm styles.

ps: If you want to upload markdown to gitee, use command :GenTocGitLab may better.

from vim-markdown-toc.

bdgong avatar bdgong commented on May 16, 2024

OK, thank you very much~

from vim-markdown-toc.

bdgong avatar bdgong commented on May 16, 2024

I am not familiar with vimscript, but I'm wondering whether I could modify your code to achieve my goals. Could just give some tips? Appreciate for your help

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 16, 2024

Sadly you can't generate toc once, work well in all of markdown preview, GitHub, Gitee, or even any two of them.

If you just want to use toc in markdown preview, maybe we can add a command :GenTocMarked for iamcco/markdown-preview, like :GenTocGFM for GitHub, :GenTocGitLab for GitLab. You can ref

function! s:GetHeadingLinkGFM(headingName)
for how to implement.

from vim-markdown-toc.

bdgong avatar bdgong commented on May 16, 2024

That's what I need, thank you

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 16, 2024

You are welcome. And...welcome to PR for this if you implement it. 😆

from vim-markdown-toc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.