MacDownApp / MacDownApp/macdown

Export to PDF loses white spaces in code block

Open
#1,196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rich Text Format
Stars
9.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

**In the preview I'm able to select the code block and copy to another editor and keep the white spaces**

* Macdown with preview:

image

* Copy and paste to a Vim editor:

image

**When I export to PDF, and I try copying the code block to another editor and it loses all the white spaces**

* Exported PDF:

image

* Copy and paste to Vim editor:

image

**How can I keep the white spaces when I export the .md to .pdf and copy the content to another editor?**

From other issues I tried adding this:

image

and this:

image

**Nothing changed**

**Any suggestion?**

Contributor guide

Open the contributing guide

Research direction

The issue names no source file, test, or entry point. First reproduce the Markdown-to-PDF export and compare copied code-block text with the preview, then trace the macOS app's PDF export path. Done means copied code retains the code block's whitespace.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, objective-c
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.