deathau / markdownload

A Firefox and Google Chrome extension to clip websites and download them into a readable markdown file.
Apache License 2.0
2.72k stars 211 forks source link

code blocks don't have linefeeds between lines. #191

Open Smitty010 opened 1 year ago

Smitty010 commented 1 year ago

When I download a obsidian article that has the 3 backtips for a code block (e.g., dataview article), the code inside the block runs together with no linefeeds. So, i see something like:

tasksnot donedue before tomorrowsort by priorityhide backlinkhide due date

instead of

not done
due before in 2 days
sort by priority
hide backlink
hide due date

It looks like the linefeeds are getting lost. feels like a bug??

As an aside, it might also be good to not have the block type with the back ticks. So

tasks
not done
due before in 2 days
sort by priority
hide backlink
hide due date

This prevents the code from getting executed by Obsidian just because I added the article.

deathau commented 1 year ago

Could you add a link to a page that does this so I can have a closer look? Thanks.

Smitty010 commented 1 year ago

Here's an example: https://beingpax.medium.com/how-to-use-obsidian-as-a-task-manager-6643bbcb1911

a-ski commented 1 year ago

Hi. Any news on this issue? Seems like the extension ignores line breaks (\
) while converting preformatted text elements (\

).  Here's a page you can test out: https://itnext.io/docker-tips-about-none-images-39fb34b20bc5

akhiljalagam commented 1 year ago

same issue on this page too https://medium.com/@dchouhan93/automating-container-instances-draining-in-amazon-ecs-using-lambda-and-asg-lifecycle-hook-383c8f3557f7

setanarut commented 8 months ago

Code blocks are flattened, newlines are ignored. Please someone fix this.

Ekran Resmi 2023-12-20 23 56 33

Smitty010 commented 8 months ago

I think this is related to https://github.com/deathau/markdownload/issues/272 and https://github.com/deathau/markdownload/issues/278. I suspect it's a difficult problem, but the new changes made the problem worse.

setanarut commented 8 months ago

I think this is related to #272 and #278. I suspect it's a difficult problem, but the new changes made the problem worse.

The example I gave is not medium.com. this long article -> https://threedots.tech/post/making-games-in-go/

Smitty010 commented 8 months ago

I don't think it's unique to medium, but medium has a particularly ugly result with the medium code blocks. All of them relate to rendering the code block. Hopefully, there is a general solution.