Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of Smart punctuation / Simple typographic replacements #139

Open
return42 opened this issue Apr 6, 2022 · 3 comments
Open

Support of Smart punctuation / Simple typographic replacements #139

return42 opened this issue Apr 6, 2022 · 3 comments
Labels

Comments

@return42
Copy link

return42 commented Apr 6, 2022

Is there any plan to support Smart punctuation?

By example en-dash, em-dash and curly quotes commonmark.js ..

- en-dash: foo -- bar
- em-dash: foo --- bar
- curly quotes: 'hello'

is rendered

<ul>
<li>en-dash: foo – bar</li>
<li>em-dash: foo — bar</li>
<li>curly quotes: ‘hello’</li>
</ul>

Instead of smart punctuation it might be better to just do some simple typographic replacements, like it is done in the markdown-it-py project.

* ``(c)``, ``(C)`` → ©
* ``(tm)``, ``(TM)`` → ™
* ``(r)``, ``(R)`` → ®
* ``(p)``, ``(P)`` → §
* ``+-`` → ±
* ``...`` → …
* ``?....`` → ?..
* ``!....`` → !..
* ``????????`` → ???
* ``!!!!!`` → !!!
* ``,,,`` → ,
* ``--`` → &ndash
* ``---`` → &mdash
@pbodnar
Copy link
Collaborator

pbodnar commented Apr 9, 2022

Hi @return42, AFAIK the support for Smart punctuation as you describe is not in the plan, yet it might be something to consider - I think some kind of an optional "(raw)text replacements module" could be implemented...

And thanks to the link to markdown-it-py - it looks like a promising project, surely more active than this one and although defining an own renderer in it doesn't seem so straightforward as in mistletoe at the 1st sight (and there is just the HTML renderer available OOTB?), I guess I will check it out sooner or later. :)

@pbodnar pbodnar added the feature label Apr 9, 2022
@return42
Copy link
Author

@pbodnar TBH I am coming from reST markup (Sphinx-doc framework), we also have some content in our project written in markdown. For a while we used mistletoe to render some online (HTML) pages from this content but these days we changed to markdown-it-py since this is the same parser we used in Sphnix-doc (the myst-parser is based on). Hope you are not disappointed by our decision, but its easier for us to maintain one markdown parser than having twice in the same project.

Anyway .. thanks a lot for taking the time!!

@pbodnar
Copy link
Collaborator

pbodnar commented Apr 12, 2022

@return42, yeah, I think your move is only logical, thx for the insight. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants