Comments (8)
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.
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.
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.
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.
@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.
@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.
is the last problem described duplicate of the issues: #79 and #56 ?
from markdowntoc.
This might be fixed in 2.4.0.
from markdowntoc.
Related Issues (20)
- GFM Compliancy Issues HOT 5
- Discrete Headings: Allow Selective Exclusion from TOC HOT 6
- Attribute 'compatible' HOT 2
- Broken autolink when two or more _ (underscores) used in the title HOT 5
- Broken autolink when - (dash) used in the title HOT 6
- feature_request(option): ids of parent headers in repeated ids
- ValueError: list.remove(x): x not in list HOT 3
- Ignore comments in blocks of code HOT 1
- Markdown Preview compatible: Markdown HOT 1
- Autocomplete valid properties
- Standardize Single Quote Usage HOT 6
- Provide a MarkdownTOC CLI Tool for non-ST Users HOT 1
- MarkdownTOC v4.1.0 Not Working HOT 6
- Remove `.python-version` HOT 6
- Add support for .mdx files HOT 1
- Incorrect underscore handling HOT 3
- QUESTION: link of different MD file into one MD file collected by TOC HOT 1
- Open settings side-by-side with one command instead of separately in two commands
- can not insert markdown TOC in Sublime Text, Build 4121 on Macos Catalina 10.15.7. HOT 2
- Attribute "levels" prevents generation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdowntoc.