retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.87k stars 199 forks source link

Feature request: backslash for hard line break #410

Closed j77h closed 5 years ago

j77h commented 5 years ago

The CommonMark Spec says that a hard line break can be set by a backslash instead of 2 spaces. https://spec.commonmark.org/0.28/#hard-line-break But ReText 7.0.4 does not convert it to \
.

Trailing spaces are problematic because I set my text editor (SciTE) to remove them on save. I rely on that option; if I turn it off I waste time tidying line ends, and SciTE's auto-indenter leaves many 'empty' lines of spaces or tabs. The editor in ReText lacks some features that SciTE has (and I've been using SciTE daily for 10+ years), so I tend to write a doc in ReText, massage it in SciTE, then use ReText to export it to html.

Many thanks for ReText, it's great! Before I found it I was writing html entirely in SciTE, because there's no clean open-source wysiwyg html writer (they all add too much redundant code).

mitya57 commented 5 years ago

First of all, CommonMark is a different language from Markdown. It is better standardized but also has many features that the original Markdown does not have. ReText is primarily a Markdown editor.

However, ReText supports Python-Markdown extensions. And it appears that there is already an extension that supports this feature.

So getting the behavior you want is as easy as:

j77h commented 5 years ago

Neat, thanks! Don't know how I missed Python-Markdown extensions before. Might end up using nl2br instead, and will definitely use Smarty.