Comments (1)
So the root cause of both this issue as well as #69 is that we're not treating headers as Markdown; rather we're treating them as plain text and doing some simple regex transformation on that text.
What we should be doing is parsing headers into something like a syntax tree for Markdown, determining what text is actually displayed vs. hidden per Markdown's rules, and rendering an anchor tag in the ToC accordingly.
/cc @thlorenz
from doctoc.
Related Issues (20)
- TOC Does not generate in a file produced from a powershell script.
- Support for .mdx files HOT 4
- Feature request: add ability to include headings before the TOC's `<!-- START -->` flag HOT 3
- Create title and description before table of contents HOT 1
- Feature Request: Generate TOC across multiple md docs
- containerize doctoc HOT 4
- %5C bug with --github option HOT 2
- Migrate Travis-CI.org to Travis-CI.com / Re-enable CI HOT 3
- Hala
- Smashing on someone, standing on, laying on ect....
- version mismatch between npmjs and github
- Not correct link
- Feature request - numbers instead of bullets
- Hi
- Rest API autopilot trade buy and sell,make binance Cridit card give maximum amount for trading and withdraw
- Sent
- Killer
- Feature request: Option for ToC numeration HOT 1
- Extremely slow with 700KB file
- Alternative doctoc watermark setting
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 doctoc.