Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf8 toc generation bug #109

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

zeitounator
Copy link
Contributor

@zeitounator zeitounator commented Feb 1, 2021

Fixes #77
The bug was introduced in #104

You will find a test file here: https://github.com/zeitounator/random-files/blob/main/gh-markdown-toc-%23109-test-file.md#do-you-like-c

Important note: the bug was only present when generating the toc from a local file so you will have to save the raw content to a local .md file prior to testing. Here is the raw content from the url for reference. I kept the url to make sure there are no drawbacks when calling it directly.

# Test file for https://github.com/ekalinin/github-markdown-toc/pull/109
## Make sure bug fixed in #104 is still ok
### Do you like C++
## Make sure bug introduced in #104 is fixed
### Quels sont les prérequis pour installer C++
### Un apperçu des conditions de circulation
### 这是一个例子

From what I can see:

  • Title text retains the + when present as fixed in Fix for issue#100 ("+"s in titles) #104
  • urls for titles with special chars are again generated correctly
  • generating directly from url is still ok after this fix

Generating from file before the fix:

Table of Contents
=================

   * [Test file for <a href="https://github.com/ekalinin/github-markdown-toc/pull/109">https://github.com/ekalinin/github-markdown-toc/pull/109</a>](#test-file-for-httpsgithubcomekaliningithub-markdown-tocpull109)
      * [Make sure bug fixed in #104 is still ok](#make-sure-bug-fixed-in-104-is-still-ok)
         * [Do you like C++](#do-you-like-c)
      * [Make sure bug introduced in #104 is fixed](#make-sure-bug-introduced-in-104-is-fixed)
         * [Quels sont les prérequis pour installer C++](#quels-sont-les-pr\xC3\xA9requis-pour-installer-c)
         * [Un apperçu des conditions de circulation](#un-apper\xC3\xA7u-des-conditions-de-circulation)
         * [这是一个例子](#\xE8\xBF\x99\xE6\x98\xAF\xE4\xB8\x80\xE4\xB8\xAA\xE4\xBE\x8B\xE5\xAD\x90)

Generating from file after the fix. Generating from url unaffected (same toc before and after):

Table of Contents
=================

   * [Test file for <a href="https://github.com/ekalinin/github-markdown-toc/pull/109">https://github.com/ekalinin/github-markdown-toc/pull/109</a>](#test-file-for-httpsgithubcomekaliningithub-markdown-tocpull109)
      * [Make sure bug fixed in #104 is still ok](#make-sure-bug-fixed-in-104-is-still-ok)
         * [Do you like C++](#do-you-like-c)
      * [Make sure bug introduced in #104 is fixed](#make-sure-bug-introduced-in-104-is-fixed)
         * [Quels sont les prérequis pour installer C++](#quels-sont-les-prérequis-pour-installer-c)
         * [Un apperçu des conditions de circulation](#un-apperçu-des-conditions-de-circulation)
         * [这是一个例子](#这是一个例子)

@ekalinin ekalinin merged commit 109a90d into ekalinin:master Feb 2, 2021
@ekalinin
Copy link
Owner

ekalinin commented Feb 2, 2021

Thanks!

@zeitounator zeitounator deleted the fix/utf8-toc-generation-bug branch February 2, 2021 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If the title is Chinese Jump is not supported after toc is generated
2 participants