fletcher / MultiMarkdown-4

This project is now deprecated. Please use MultiMarkdown-6 instead!
https://github.com/fletcher/MultiMarkdown-5
Other
307 stars 59 forks source link

Syntax proposal for hyphenation in HTML output #110

Closed mn4367 closed 9 years ago

mn4367 commented 9 years ago

Many current browsers support automatic hyphenation via CSS, for example:

p {
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}

But hyphenation only works, if a lang attribute (for example lang="de") is present on the HTML element for which automatic hyphenation should be applied. Since most documents only use one language it's common to set the lang attribute on the <html> element. The lang attribute of an HTML document is, for example, also used by screen readers, which can select an appropriate voice for the document language.

Adding this to MultiMarkdown could be done with metadata, for example:

lang:   de

Unterstützung für automatische Silbentrennung in MultiMarkdown ...

should produce the following result:

<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="utf-8"/>
</head>
<body>

<p>Unterstützung für automatische Silbentrennung in MultiMarkdown &#8230;</p>

</body>
</html>

The proposed HTML output shows that the lang metadata is not written as a meta element to the headelement, so the behaviour is the same like for Quotes Language.

Thanks, Michael

fletcher commented 9 years ago

Done. Thanks!

mn4367 commented 9 years ago

Wow, this went quick. It will get framed in my home as the MMD proposal with the shortest possible positive answer :smile:.

Thanks very much! Michael