Proposal for (source-side) hyphenation support
Fletcher T. Penney
fletcher at fletcherpenney.net
Sat Apr 1 17:45:33 EDT 2017
On 4/1/17 5:16 PM, Aristotle Pagaltzis wrote:
>
>>> 4. As to your specific syntax suggestion, this would not work well
>>> in MultiMarkdown, as the `\\\n` syntax is already used to indicate
>>> linebreaks, in addition to the ` \n` (space-space-newline) to
>>> improve visibility.
>>>
>>> <http://fletcher.github.io/MultiMarkdown-5/escaped-newlines.html>
>> Every language where I've seen escaped new-line chars so far, used it
>> to ignore the line break.
> That’s exactly what Fletcher just said MultiMarkdown already does.
>
>> We should fix MultiMarkdown then ;) just kidding
> What’s there to fix?
Actually, MMD doesn't use escaped new-lines to ignore, but rather to
convert to <br/>. In fact, the default action is to ignore newlines, so
I'm unclear as to why one would escape them for that purpose:
This line\n
and another line.
The newline character is ignored -- the generated HTML (or LaTeX or ODF,
etc) treats the output the same whether the text is included on a single
line (replacing \n with a space) or keeping the \n intact.
I don't understand how Markdown could ignore the newline any more than
it already does. ;)
MMD allows this:
This line\\\n
and another line.
to become:
<p>This line<br/>
and another line.</p>
The main reason being that it is difficult to quickly identify the
"space-space-newline" syntax otherwise required to insert a linebreak
(unless your text editor specifically flags it in some way -- MMD
Composer does this, for instance).
(I realize this is tangential to the main thread, but didn't want to
confuse anyone stumbling across this thread.)
Fletcher
PS> I just reread your (Nico) comment again, and realized that when I
read "every language" I assumed you meant "every Markdown variant",
which honestly did not make much sense to me (as above). If instead, I
substitute "every programming language", then your comments do make
sense to me, as newlines are not necessarily ignored in all programming
languages. In that case, however, the default is to ignore them so a
separate notation to tell Markdown to ignore a newline is unnecessary.
In that scenario, one should not read the "\\\n" syntax as escaping a
newline per se, but rather hijacking the escape syntax for a slightly
different purpose so that I did not have to introduce an entirely new
syntax for linebreaks. In MMD version 6, I do the same thing for
"\\space" to mean a non-breaking space. The advantage of this syntax is
that the fallback for "\\\n" and "\\space" in other Markdown parsers
besides MMD is to simply treat them as a regular newline and regular
space, which is not the end of the world in most situations.
--
Fletcher T. Penney
fletcher at fletcherpenney.net
More information about the Markdown-Discuss
mailing list