typogrify icon indicating copy to clipboard operation
typogrify copied to clipboard

--- (3 dashes) should be converted to a single mdash

Open xuhdev opened this issue 8 years ago • 3 comments

Currently, the following lines produces an mdash and a dash:

from typogrify.filters import typogrify
print(typogrify("---"))

prints

—-

but it really should print a single mdash---otherwise how to produce an ndash? See the wikipedia to read more details.

xuhdev avatar Aug 19 '16 05:08 xuhdev

I think we could possibly add support for converting --- to an em-dash, but I do not think we will change the -- conversion behavior to produce an en-dash. Using -- as a proxy for an em-dash is too deeply ingrained in traditional text behaviors, as well as mainstream operating systems that automatically replace -- with an em-dash.

When I want an en-dash, I use the en-dash itself in the source content. Seems to work fine.

justinmayer avatar Aug 20 '16 14:08 justinmayer

OK, thanks... Maybe we should just support 3 dashes...

xuhdev avatar Aug 20 '16 20:08 xuhdev

For folks using Markdown, the SmartyPants extension in Python-Markdown already handles this.

justinmayer avatar Apr 23 '20 07:04 justinmayer