Giter Site home page Giter Site logo

Comments (8)

naokazuterada avatar naokazuterada commented on June 15, 2024

Hi, thanks for your post.

Is problem you reporting appeared on Github ?
If so, it's same as #13 .
I will try to implement a new feature.

Thanks.

from markdowntoc.

naokazuterada avatar naokazuterada commented on June 15, 2024

@raybit

Hi,
I've misunderstood your post. (Sorry..., I'm not good at English)

Did you mean it should be like

<!-- MarkdownTOC depth=2 -->

- [Heading with anchor][with-anchor]

<!-- /MarkdownTOC -->

# Heading with anchor [with-anchor]

not like

<!-- MarkdownTOC depth=2 -->

- [Heading with anchor](#with-anchor)

<!-- /MarkdownTOC -->

# Heading with anchor [with-anchor]

?

It used to be like the former according to "Reference-style links", but I have been notified of that some markdown render (e.g. Github) cannot support it by users, and changed implementation.

You propose that this plugin should also support the former style ? Right?
I will consider that.
So please answer my understanding is correct or not?

from markdowntoc.

raybit avatar raybit commented on June 15, 2024

Please copy and paste following text as markdown and then you will know what I'm talking about.

<!-- MarkdownTOC depth=3 autolink -->
- [random1](#random1)
    - [random2](#random2)
    - [random3](#random3)
        - [issue0](#ID-String)
        - [](#issue1)
        - [](#issue2)
        - [issue3      {#custom-ID}](#issue3------{custom-id})
        - [](#issue4)
        - [the chars in the mid ()+-*/ 日本 is Ignored](#the-chars-in-the-mid---日本-is-ignored)
        - [日本](#日本)

<!-- /MarkdownTOC -->

# random1 
## random2
## random3


### issue0 [ID-String]
This format/style is curretly allowed in the TOC's to define header's ID, but as I mentioned this syntax is wrong and it can't be explained in any Markdown style.  [According to this link syntax section](http://aringfireball.net/projects/markdown/syntax#link), the link text is always delimited by [square brackets]. However, your current supported style didn't use square bracket around link text. 

### [issue1][my-anchor]
If we use a normal reference link style on header, TOC will always treat the strings in the first square brackets as an anchor.
[my-anchor]: http://www.googl.com

### [issue2](www.google.com)
if we use a normal inline link style on header, it has same issue.

### issue3      {#custom-ID}
If we use this MarkDown-Extra style to define ID, TOC also can't recongise it, and treat ID as a part of header string. Well, this is not caused by wrong grammer but it is just annother helpful feature to implement, or say it could be a nice replacement of current wrong implement since they share similar syntax structure. 


Overall, due to the wrong usage of link syntax in header line, the detection and extraction of right link/ID is not implemented.  

-----
And here is an another relevant issue. 
Although headers could auto generate ID and that ID can be used as anchor and this auto extraction processing of header ID works fine on most of render, it is not true for non-english header as you may have noticed.
  > The render will ignore all of those non-english char and special sign in header line when it try to extract header's ID string. And that's why we still need to set ID for header for those non-english header.

### issue4: autolink + non-english char = wrong achnor
Since current autolink feature won't ignore non-english char. FE:
### the chars in the mid ()+-*/ 日本 is Ignored
### 日本 

You may have to also ignore non-english chars and find a way to generate the right ID String if header line only contains non-english and special chars.

from markdowntoc.

naokazuterada avatar naokazuterada commented on June 15, 2024

Hi, thanks for explanation.

Issue0, 1, 2, 3 has been fixed on 1.4.0. See more details on README.md( some feature has been added ).

About Issue4,
On github, Japanese chars are not ignored. I want this features to be optimized to github not to official markdown specifications.

from markdowntoc.

johnathanz avatar johnathanz commented on June 15, 2024
@raybit, thanks for the comprehensive explanation.  I'm not sure if this is correct behaviour. When I use the following syntax:
### 1 Next Release [next-release]
OR
### 2 Next Release {#next-release}
MarkdownTOC generates:
[1 Next Release][next-release]
When I use MarkdownPreview (https://github.com/revolunet/sublimetext-markdown-preview), it displays the TOC as it is, there is no link.
Am I not using the right Markdown syntax?
Thanks!

from markdowntoc.

stlehmann avatar stlehmann commented on June 15, 2024

@johnathanz got the same propblem.

If I use the square brackets for links there will be no Links when viewing it with MarkdownPreview. With the round brackets it works but only for Markdown style, not Github.

Also Links with non-ascii characters such as (Ü, Ä, Ö, ... ) don' t work.

from markdowntoc.

jonasbn avatar jonasbn commented on June 15, 2024

is the last problem described duplicate of the issues: #79 and #56 ?

from markdowntoc.

naokazuterada avatar naokazuterada commented on June 15, 2024

This might be fixed in 2.4.0.

from markdowntoc.

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.