Comments (9)
@ekalinin same problem appears on my MacBook.
Hey @duyanghao! Thanks for report.
Could you provide an example? (What is the source README? What TOC did you get? What TOC did you expect?)
Q1: What is the source README?
## 这是一个例子
这是段落内容
Q2: What TOC did you get?
Table of Contents
=================
* [这是一个例子](#\xE8\xBF\x99\xE6\x98\xAF\xE4\xB8\x80\xE4\xB8\xAA\xE4\xBE\x8B\xE5\xAD\x90)
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
Q3: What TOC did you expect?
Table of Contents
=================
* [这是一个例子](#这是一个例子)
from github-markdown-toc.
Could you provide an example?
from github-markdown-toc.
@yangchongduo you can urlencode the chinese text as toc tag.
For example :
$ echo '标题' | tr -d '\n' | xxd -plain | sed 's/\(..\)/%\1/g'
%e6%a0%87%e9%a2%98
Then in markdown, your tag may be like this
* [标题](#%e6%a0%87%e9%a2%98)
from github-markdown-toc.
BTW, I just test Chinese title in my environment, it works fine without url encoding.
Maybe it's related to your environment ?
My enviroment: win10, typora
from github-markdown-toc.
Example of a TOC I tried generating that didn't work: https://github.com/flasgger/flasgger/blob/ba6ca6233611378704d490b1fa6045d5e803b150/README.zh.md
The TOC has weird encoding like this:
* [高度参与的贡献者](#\xE9\xAB\x98\xE5\xBA\xA6\xE5\x8F\x82\xE4\xB8\x8E\xE7\x9A\x84\xE8\xB4\xA1\xE7\x8C\xAE\xE8\x80\x85)
Clicking on it does nothing.
If I click the link icon next to a header, the anchor just contains the Chinese characters directly, no encoding.
I'm on Chrome on Ubuntu.
from github-markdown-toc.
@ekalinin same problem appears on my MacBook.
from github-markdown-toc.
@ekalinin same problem appears on my MacBook.
Hey @duyanghao! Thanks for report.
Could you provide an example? (What is the source README? What TOC did you get? What TOC did you expect?)
from github-markdown-toc.
Note: if you feel like the following is not related, please just let me know and I will create a separate and complete bug report.
Unless I missed something, the problem is now exactly the same with any title containing special chars in any language (accents, cedillas, tilde, etc....). And this used to work without problems in older versions. I have no idea when the problem was introduced. I don't have time now to have a look but I will follow this ticket and may dig into it if possible/needed.
The only info I can give right now: I generated a toc 3 month ago that was correct. In between I upgraded gh-md-toc at least twice and the generation on same tiltles this morning is broken.
Abridged example:
Titles in my file (this is in French, all my files are UTF-8):
# Aperçu
# Prérequis
Toc generated back then:
* [Aperçu](#aperçu)
* [Prérequis](#prérequis)
Toc generated today:
* [Aperçu](#aper\xC3\xA7u)
* [Prérequis](#pr\xC3\xA9requis)
Cheers.
from github-markdown-toc.
I was able to validate we all suffer from the same problem: utf-8 encoded chars in href returned from google makdown api call are not decoded anymore.
With a rapid empiric tests, I noticed that version 0.6.0 was working correctly and with git bisect
, I was able to trace the problem down to commit 495dfb3 which is related to #104.
I'm currently looking at the part that was added to awk script to see how to fix it. I'll push a PR if I find a solution.
from github-markdown-toc.
Related Issues (20)
- [ BUG ] No --insert option in homebrew's gh-md-toc HOT 3
- [Feature] NPM Package HOT 1
- [ BUG ] ":" symbol generates unnecessary hyphen
- [Feature] Auto insert support recursive folders, and auto skip files without `<!--ts-->` HOT 2
- [Feature] Add --hide-footer when using --insert
- [ BUG ] Wrong filename in Github Action (the trailing ".md" should be removed)
- [Feature] Suggestion: put `Created by …` as a HTML comment HOT 1
- [ BUG ] Insert does not work on MacOS 10.15.7 zsh HOT 4
- [Question] release HOT 1
- [SKIP headers before ts -- te] HOT 2
- [Feature] Documentation enhancement for Github Actions
- [ BUG ] --indent argument makes the script crashed
- [ BUG ] ... HOT 2
- 1. Add Content in a block. Example -
- [ BUG ] ... Unable to generate TOC
- [ BUG ] ...
- [ BUG ] No Table of Contents output HOT 2
- [Question] Is this still working? HOT 7
- [Feature]
- [Question] how to bring up command probiotics iphoo ok fr se
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 github-markdown-toc.