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

TOC extension not working on Convert Markdown to PDF #31

Closed
ezequias opened this issue Aug 26, 2017 · 7 comments
Closed

TOC extension not working on Convert Markdown to PDF #31

ezequias opened this issue Aug 26, 2017 · 7 comments
Milestone

Comments

@ezequias
Copy link

I can't see links working on a generated pdf from markdown to pdf extension. TOC extension is working on default markdown preview on VSCode.

  • VSCode Version: 1.15.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Write a nice markdown text (with many #, ## and ###)
  2. Enable TOC on Markdown (with Markdown TOC extension)
  3. Convert Markdown to PDF (with Markdown to PDF extension)

If you have any plans to solve this reporting please tell me.

@dio833
Copy link

dio833 commented Aug 29, 2017

Hello

I convert md to html file with Markdown PDF then trace html code.

I see the tag <h1-6> doesn't has ID attribute. So Anchors can't work.

Could you keep the ID attribute of <h1-6> tag ?

Thanks.

@ezequias
Copy link
Author

@dio833 I didn't understand you. How did you convert md to html with Markdown PDF? Is it another extension? All my attributes are from h1 to h6 but I confess it has some spaces on links generated.

Would be nice if the extension only could create a hyperlink only about the first word of the markdown ID.

@dio833
Copy link

dio833 commented Aug 29, 2017

@ezequias
>user setting open youre user setting then find "markdown-pdf.type".

You can choose output format. such as "markdown-pdf.type": "html",.

In HTML source , all h1~h6 tags miss ID attribute. So Markdown TOC can't work well here.

You can add id into h1~h6 tags manually . or maybe @yzane can fix this issue.

@ezequias
Copy link
Author

@dio833 nice tip. I like it! ;)

@coop333
Copy link

coop333 commented Sep 26, 2017

This is related to issue #6

@kkhrv
Copy link

kkhrv commented Nov 3, 2017

As I see, using ID attributes is not enough to fix issue: phantomjs doesn't work well with internal links: ariya/phantomjs/issues/13959

@yzane
Copy link
Owner

yzane commented Apr 15, 2018

I pre-released Markdown PDF ver1.0.0 which replaced pdf converter with puppeteer instead of html-pdf.
Please download from here and try.

@yzane yzane closed this as completed Apr 21, 2018
@yzane yzane added this to the 1.0.0 milestone Apr 22, 2018
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

No branches or pull requests

5 participants