maaslalani / slides

Terminal based presentation tool
http://maaslalani.com/slides/
MIT License
9.65k stars 264 forks source link

Slides parsing fail on Windows #231

Closed Selyss closed 1 year ago

Selyss commented 1 year ago

Describe the bug Windows does not parse slide-specific text such as --- for new slides and metadata. This issue only occurs for markdown files given in args, not for the default display with no arguments.

To Reproduce Steps to reproduce the behavior:

  1. Install slides on Windows through Go
  2. Make a presentation file and cd to the directory
  3. Execute slides example.md
  4. Slides will display the characters for headings and normal markdown elements, but will not correctly build graphs, add new slides.

Expected behavior Slides will display as normal, with any metadata hidden and slide divisions when encountering a ---.

Screenshots image

As you can see, slides displays as normal, but doesn't recognize new slides and other program specific elements.


image

Example of metadata issue


Desktop (please complete the following information):

Additional context The program only seems to have issue with custom symbol parsing, it can display markdown as expected. Any help appreciated!

shivaraj-bh commented 1 year ago

Same issue on M1 mac with wezterm

Screenshot 2023-04-10 at 1 11 23 PM
krakpot commented 1 year ago

I think this issue is related to DOS "\r\n" line breaks vs Unix "\n" and slides only seem happy with the latter.

Latest slides installed in Windows 10 using go

If I open a file with DOS line breaks "---" will not be interpreted correctly:

slides test_crlf.md

bild

If I explicity save this file with Unix line endings it works fine

slides test_unix.md

bild

Example files (I hope github does no line break conversion...) test_crlf.md test_unix.md

Selyss commented 1 year ago

I think this issue is related to DOS "\r\n" line breaks vs Unix "\n" and slides only seem happy with the latter.

Latest slides installed in Windows 10 using go

If I open a file with DOS line breaks "---" will not be interpreted correctly:

slides test_crlf.md

If I explicity save this file with Unix line endings it works fine

slides test_unix.md

bild

Example files (I hope github does no line break conversion...) test_crlf.md test_unix.md

Worked for me! What did you change about the files?

krakpot commented 1 year ago

The only difference is that one of the files has DOS/Windows line endings (\n\r instead of just \n as is standard in unix). I downloaded the files (as I created them when I was at work) from my comment above just to verify that github didn't do any conversion:

user$ file test_crlf.md
test_crlf.md: ASCII text, with CRLF line terminators
user$ file test_unix.md
test_unix.md: ASCII text

I can reproduce this also with slides v0.9.0 on macOS Ventura (installed from brew slides--0.9.0.arm64_ventura.bottle.tar.gz):

slides test_crlf.md

bild

slides test_unix.md

bild

If I convert test_crlf.md using dos2unix (which converts line endings to unix format) it will display correctly with multiple slides

krakpot commented 1 year ago

I get the same behaviour with the above two files under Ubuntu 22.04.2 LTS using slides 0.9.0 installed via snap