zhuochun / md-writer

✒️ Make Atom a better Markdown/AsciiDoc editor for writers and bloggers
https://atom.io/packages/markdown-writer
MIT License
341 stars 46 forks source link

Slash (/) in ToC #281

Closed mjaquiery closed 5 years ago

mjaquiery commented 5 years ago

ToC links containing / character are broken When using Insert/Update Table of Contents the links created do not work where there is a / in the heading name. This is because the ToC truncates / to an empty string, while the code responsible for assigning ids to headings replaces / with -.

To Reproduce Steps to reproduce the behavior:

  1. produce a document with a / in the headings:
    ## Test/Example
  2. insert ToC
  3. Open in browser and click the link.
  4. Note that the search path in the URL does not match the header tag's id.

Expected behavior The link should scroll the page to the appropriate header.

zhuochun commented 5 years ago

Which tool does you use to generate from Markdown to HTML?

Currently, the TOC follows GitHub markdown rendering, / is removed when generating anchor ID.

mjaquiery commented 5 years ago

I think it’s this: https://atom.io/packages/markdown-to-html If it’s the fault of the interpreter then sorry for bothering you! Matt

From: Zhuochun notifications@github.com Sent: 29 March 2019 15:27 To: zhuochun/md-writer md-writer@noreply.github.com Cc: Matt Jaquiery matt.jaquiery@psy.ox.ac.uk; Author author@noreply.github.com Subject: Re: [zhuochun/md-writer] Slash (/) in ToC (#281)

Which tool does you use to generate from Markdown to HTML?

Currently, the TOC follows GitHub markdown rendering, / is removed when generating anchor ID.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/zhuochun/md-writer/issues/281#issuecomment-478039997, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AcVOh-VV45uwvqKVTZMa7fRDZf_d0BTVks5vbjDHgaJpZM4cQezQ.

zhuochun commented 5 years ago

Cross checked on https://stackedit.io/app , slash is removed in anchor generation.

Thanks for the report.