remark: Option to use two spaces instead of backslash for hard line break

Initial checklist

Problem

I’d like to use two spaces instead of a backslash for hard line breaks.

Currently, remark-stringify seems to default to a backslash without any option to use whitespace instead.

Related issues https://github.com/remarkjs/remark/issues/249 and https://github.com/syntax-tree/mdast-util-to-markdown/issues/30.

Solution

An option to use multiple spaces instead of a backslash for hard line breaks.

It seems the serialization is done by mdast-util-to-markdown which hardcodes the backslash in lib/handle/break.js#L31.

Alternatives

None.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 15 (9 by maintainers)

Most upvoted comments

I have mixed feelings about this. I agree it’s nice to support different syntaxes for formatting the output. On the other hand I believe using trailing spaces for syntax is the absolute very worst part of the commonmark spec that nobody should ever use.

IMO the best argument for supporting this, would be a practical example of a tool that only supports parsing line breaks using trailing spaces. However, the only argument given is that it’s personal preference.

It’s true there’s not a universal right or wrong here. However, I consider spaces for line breaks really bad. I think it’s in a way similar to the JavaScript with statement. It exists, and parsers should support it. However, it’s really bad, and you should avoid it.

Also note that line breaks should typically not occur in text anyway. The only legitimate use case that comes to mind is poetry / song lyrics.

so it sounds like you’re ignoring the published specification for the thing your project is basically infrastructure for based on … personal taste?