vscode-markdown-preview-enhanced icon indicating copy to clipboard operation
vscode-markdown-preview-enhanced copied to clipboard

[BUG] Table of Contents Links Jump 11 Pages Ahead in PDF

Open imudak opened this issue 8 months ago • 2 comments

Description

When generating a PDF from a Markdown file using the Markdown Preview Enhanced (MPE) extension in VSCode, clicking on Table of Contents (TOC) links results in navigating to a position 11 pages ahead of the intended section.

Environment

  • OS: Windows 10
  • VSCode Version: 1.90.2
  • Markdown Preview Enhanced Version: 0.8.13

Steps to Reproduce

  1. Create the following Markdown file:

    # Title
    
    - [Section 1](#section-1)
    - [Section 2](#section-2)
    - [Section 3](#section-3)
    
    ## Section 1
    
    Content
    Content
    Content
    ...
    Content
    Content
    
    ## Section 2
    
    Content2
    
    ## Section 3
    
    Content3
    
  2. Generate the PDF using MPE in VSCode:

    • Go to Export -> Chrome (Puppeteer) -> PDF.
  3. Open the generated PDF and click on any TOC link.

Expected Behavior

Clicking on a TOC link should navigate to the corresponding section in the PDF.

Actual Behavior

Clicking on a TOC link navigates to a position 11 pages ahead of the intended section.

Additional Information

If the PDF does not contain at least 11 pages, clicking the TOC links causes the PDF to crash.

Request for Assistance

Please assist in resolving this issue. If any additional information is required, feel free to contact me.

imudak avatar Jun 21 '24 08:06 imudak