Incorrect wrapping / centering
Describe the bug The wrapping and centering is incorrect. The output leaves space on left side, even if on right side the text clips (instead of wrapping).
To Reproduce Steps to reproduce the behavior:
- Prepare markdown file with long code line and other line that should wrap correctly
- Open the file with the viewer.
Expected behavior I should see entire plaintext (non code block) line wrapped, and the code block line overflow should be handled in some way (wrapped or horizontal scroll maybe?), and the padding on left shouldn't be there if there is insufficient space on right side.
Screenshots
Device
- OS: Windows 10
- Version 21H2 LTSC
- App Version v2.6.4
Additional context
minimal example that reproduces the issue for me:
(note the reg add line - issue goes away if you shorten that line)
# Portable Windows 10/11 on USB SSD via VHD Boot
A complete guide for creating a persistent, portable Windows installation on external USB SSD using VHD boot. This method bypasses the USB bus reset issue that normally prevents USB Windows installations.
---
## Prerequisites
Doesn't matter, for issue repro let's just add some long line code block
```batch
reg add "HKLM\OFFLINE_SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDriveTypeAutoRun /t REG_DWORD /d 255 /f
```
(edit: better trimmed screenshot)
thanks for catching that. ill add a codeblock wrap/codeblock horizontal scroll option to address this
also happens with tables too, when a cell has a long piece of text
Can confirm this happens to all tables and code blocks. I understand that wrapping inside tables or code is tricky, can we have a simple horizontal scroll at the bottom instead?
Example of no wrap:
thanks for catching that. ill add a codeblock wrap/codeblock horizontal scroll option to address this
I'll chime in and confirm that I'm experiencing this too, when working with wide tables. This bug is the sole reason that I am not using Markpad at the moment. Otherwise, great viewer/editor 👍
@alecdotdev did you start work on this feature?
Fixed in v2.6.5. The asymmetric 50% - 390px padding that produced the left-side gutter was replaced with symmetric padding: 50px clamp(24px, 5vw, 50px), and long words now wrap. Since then the column width is configurable too (Settings → Preview width) — on master, not yet released.
Thank you. I will confirm fix after the release so I can grab updated binary and will close issue (I don't have this stack toolchain and don't know how to use it). Unless you prefer to close issues yourself @PathGao ?
Edit: Sorry, I missread. The issue itself is fixed. I can confirm. The colum width seems suplementary feature to the issue. IMO issue should be closed now.