Proposal for (source-side) hyphenation support

Nico Huber nico.h at gmx.de
Sat Apr 1 06:44:39 EDT 2017


Hi Fletcher,

On 01.04.2017 04:22, Fletcher T. Penney wrote:
> Nico,
> 
> Just for the sake of giving you an on-topic reply ;) ....

thank you!

> 
> I understand that you don't want to change HTML, just the Markdown
> syntax to basically ignore manually entered hyphens at the end of lines.
> 
> 1. Markdown, per se, is frozen as it has not seen an update in 10+ years
> (I'm too lazy to check exact dates right now, but it's close enough.)
> So, at best, you could hope to get your proposal accepted by some subset
> of Markdown variants.  Or create your own.  ;)

Well, it's never too late ;) a pity though. I'll have people add it to
their software if anyone ever complains about my hyphens (I'm usually
not the one who converts my Markdown).

> 
> 2. To me, this seems to be a rather idiosyncratic request.  I understand
> that it is a desirable feature to you, but I suspect the number of
> others who desire this feature is quite low (witness that most replies
> don't even *understand* your request, much less support it.)

I thought the general idea behind Markdown is to mark up text while
maintaining readability (of the untransformed source). And I doubt the
reaction on this list counts as representative.

> 
> 3. I think your best bet is to implement it yourself in your own build
> of Markdown (or whatever variant you prefer.)  That could be done rather
> quickly, as compared to the time it would take to garner enough support
> to implement it more broadly.  Alternatively, you could quickly create a
> pre-processing script that searches for your regexp and strips out any
> matches before passing your source to your markdown processor. Something
> like the following (not tested, just to prompt actual ideas):
> 
>         cat text.md | perl -pe 's/\-\n([^\n])/$1/g' | Markdown.pl >
> output.html
> 
> 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. We should fix MultiMarkdown then ;) just kidding

> Hope some of that helps...

Yep, especially the "is frozen" part (on Daring Fireball it still says
this ML is the place to discuss "formatting syntax").

Nico

> 
> 
> Fletcher
> 
> 
> On 3/31/17 12:57 PM, Nico Huber wrote:
>> Hi there,
>>
>> don't know if this has been discussed before, or if I just overlooked
>> how to do it: I'm missing support for hyphenation in Markdown files.
>> Looking at always ragged HTML pages is already hard enough, so I can't
>> bear anything but halfway justified text in my editor and manually hy-
>> phenate words.
>>
>> I would do it as follows: 1. If a hyphen followed by a single new-line
>> character is encountered "-\n[^\n]", drop the hyphen and any following
>> whitespace. 2. In case you have to break a word that includes a hyphen,
>> you would escape the new-line character "-\\\n". Like this: Escape new-\
>> line character to preserve the hyphen. This way, the hyphen wouldn't
>> occur in front of the new-line char and 1. doesn't apply. Although, any
>> whitespace following the new-line char would also have to be dropped in
>> this case.
>>
>> What do you think?
>>
>> Regards,
>> Nico



More information about the Markdown-Discuss mailing list