Proposal for (source-side) hyphenation support

Fletcher T. Penney fletcher at fletcherpenney.net
Fri Mar 31 22:22:37 EDT 2017


Nico,

Just for the sake of giving you an on-topic reply ;) ....

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.  ;)

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.)

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>


Hope some of that helps...


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
> _______________________________________________
> Markdown-Discuss mailing list
> Markdown-Discuss at six.pairlist.net
> https://pairlist6.pair.net/mailman/listinfo/markdown-discuss
>

-- 
Fletcher T. Penney
fletcher at fletcherpenney.net


More information about the Markdown-Discuss mailing list