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

Allow users to configure markdown rendering #1492

Closed
jessleenyc opened this issue Jan 8, 2019 · 6 comments
Closed

Allow users to configure markdown rendering #1492

jessleenyc opened this issue Jan 8, 2019 · 6 comments
Labels
external contributors welcome contribution is welcome!

Comments

@jessleenyc
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Markdown can be handled in a few ways and some people will have preferences for certain things. Makes sense to let people choose how they want their markdown handled.

Describe the solution you'd like
To start, let's add the option for our markdown parser to ignore certain line-breaks. See #575 for more info. This is a setting users should be able to toggle through their settings page.

@abraham
Copy link
Contributor

abraham commented Jan 8, 2019

I would recommend against customization of markdown. Having a number of options will add a lot of code paths in an area that is already difficult to test. I would suggest using a standardized markdown implementation that aligns with CommonMark plus the liquid tags. Maybe offering an escape hatch were authors can disable markdown and switch to HTML for advanced features.

@dguo
Copy link

dguo commented Jan 8, 2019

CommonMark specifies how both hard line breaks and soft line breaks should be treated. The problem in #575 is that dev.to's parser seems to generate hard line breaks (<br>) no matter what.

Though CommonMark does say: "A renderer may also provide an option to render soft line breaks as hard line breaks."

@bwl21
Copy link

bwl21 commented Mar 16, 2019

Note that Github has a different behaviour with respect to line breaks for Issues and other places. I find this pretty strange and annoying.

see: https://github.community/t5/How-to-use-Git-and-GitHub/Why-does-markdown-in-issues-respect-line-breaks/m-p/18637

@tmr232
Copy link

tmr232 commented Mar 5, 2020

Any update on this?
I just encountered it today posting an article and having to remove breaks from all my paragraphs.

@cmgorton cmgorton added this to Backlog in Feature backlog via automation Nov 18, 2020
@arian
Copy link

arian commented Dec 18, 2020

A workaround for this is to use prettier with the --prose-wrap option set to never:

prettier post.md --prose-wrap never

That way you don't need to manually remove the newlines, and can write the post as you want.

@cmgorton
Copy link
Contributor

I am going to leave #12061 open and close this issue since they are similar but this one has been around for awhile with no traction. I think we should collect and highlight all of the markdown issues we have in the repo that are ready for dev. I am adding #12061 to a list to highlight.

maxime1992 pushed a commit to maxime1992/dev.to that referenced this issue Feb 26, 2021
As per forem/forem#1492 the dev.to renderer interprets line breaks in markdown as actual linebreaks.

Removing this formatting flag stops articles looking weird because of odd linebreak behaviour.

Co-authored-by: evil-liskov <69952973+evil-liskov@users.noreply.github.com>
gabbersepp pushed a commit to gabbersepp/dev.to-posts that referenced this issue May 1, 2024
As per forem/forem#1492 the dev.to renderer interprets line breaks in markdown as actual linebreaks.

Removing this formatting flag stops articles looking weird because of odd linebreak behaviour.

Co-authored-by: evil-liskov <69952973+evil-liskov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external contributors welcome contribution is welcome!
Projects
No open projects
Development

No branches or pull requests

9 participants