Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View with the list of drafts doesn't render the markdown correctly #902

Open
piko-piko opened this issue Feb 22, 2024 · 6 comments
Open

Comments

@piko-piko
Copy link

View with the list of drafts doesn't render the markdown correctly. When moved to the main blog, they render as intended both on view with the post list and on the individual post page.

view with the list of drafts

list

same post, post preview

post preview

Markown used:

# Markdown

----
* [składnia markdown](https://url.com)
* [składnia markdown](https://url.com)
* [składnia markdown](https://url.com)

Version or last commit: 1d89dea (v0.15.0)

@elkcityhazard
Copy link
Contributor

The issue here is the format of the --- which you have with 4 - instead of 3.

It works as expected if you remove the extra -.

# Markdown

---
* [składnia markdown](https://url.com)
* [składnia markdown](https://url.com)
* [składnia markdown](https://url.com)

@piko-piko
Copy link
Author

Thank you for your reply! Unfortunately changing it to three dashes does not change anything
1709115808

Note, that i'm talking about the "Drafts" view - in the actual post list it's being displayed as expected.
Also it's not only the separator, that breaks but also the list and hyperlinks (i must admit - it may be maybe hard to tell from the screenshots provided.)

I don't know what's the most appropriate place to quote on the markdown notation, but from what i understand three or more symbols have the same effect:
https://github.com/mattcone/markdown-guide/blob/master/_basic-syntax/horizontal-rules.md
https://www.markdownguide.org/basic-syntax/

@elkcityhazard
Copy link
Contributor

Okay, so what is actually happening is the inclusion of --- is causing the markdown renderer to behave in an unexpcted way.

YAML uses three dashes (“---”) to separate directives from document content.

The way this output is setup is that it is not expecting this. Typically you would only use the three dashes if you need to define some directives i.e., variables that you need to pass into a template language.

title: hello world
tags:
    - my tag 1
    - my tag 2

your actual content

...

So what is actually happening is it is encoding the --- as a part of your content because it is not expecting it to be passed in. If you remove the three dashes it will render correctly.

I guess the question for @thebaer is whether or not we strip these out somewhere since they aren't needed and causing this issue, or if it is enough to just not include them when writing content.

@piko-piko
Copy link
Author

piko-piko commented Feb 29, 2024

Hm. I tried to swap the --- for the <hr>, since HTML is allowed inside Markdown, but the list and urls still do not render (again: in drafts, works in posts)
1709189051
(edit: It's maybe worth noting that the <hr> line is supposed to be there, but is not rendering too. Again: works in the post view/post list view)

The fact it works for the posts list makes me think it does not need to work differently for the drafts, unless you have to keep some special metadata there. Unless i completely misunderstand the idea and drafts are supposed to not render the Markdown. Which would be unfortunate - since it's a good way to give userr a way to test how the note is going to look like in the post list view, before it gets actually posted.

@thebaer
Copy link
Member

thebaer commented Mar 14, 2024

Hi @piko-piko, this is all by design. The Drafts / post view is just meant to give you a quick overview of what each post is about -- so we purposely strip out the Markdown. If we didn't, this page could get extremely messy and long, with images and paragraphs and everything taking up space.

I'm open to hearing any reason we might change this, but the idea is that you'll click on the post itself to see exactly what it'll look like, and just use this Drafts view to quickly find the posts you're looking for.

@piko-piko
Copy link
Author

My expectation was that it would be consistent with the view of the timeline of the actually posted posts. I could argue that it provides a preview of how the post is going to look in the timeline. I completely understand your reasoning of having it as just a quick overview of posts. I think my only point is that some people might find it confusing, because it was my immediate thought and i had to go there to learn it is by design.

As an alternative solution maybe there is a better way to communicate it's just a plain text snippet of the post, but i have to admit i don't have a good idea for that

I think having the list of headlines with dates would be a proper visual distinction from the timeline view, but it also robs the user of the ability to at least peek to see what the post is about
1711105595

Alternatively the post content could be written in monospace. I've added the ⬚ unicode to further distinguish the look and imply the altered notation is intentional, but it is still pretty arbitrary
1711106707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants