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

“Smart” typographic punctuation #740

Closed
wezm opened this issue Jul 7, 2019 · 12 comments
Closed

“Smart” typographic punctuation #740

wezm opened this issue Jul 7, 2019 · 12 comments
Labels
done in pr Already done in a PR

Comments

@wezm
Copy link
Contributor

wezm commented Jul 7, 2019

This is a feature request for support for proper typographic quotes, apostrophes, en and em dashes, and ellipsis. It would be great if Zola had the ability to (optionally) filter Markdown through a process akin to Smarty Pants to turn plain text quotes, etc. into the proper typographic form.

The transformations that Smarty Pants performs are:

  • Straight quotes ( " and ' ) into “curly” quote HTML entities
  • Backticks-style quotes (``like this'') into “curly” quote HTML entities
  • Dashes (“--” and “---”) into en- and em-dash entities
  • Three consecutive dots (“...”) into an ellipsis entity
@Keats
Copy link
Collaborator

Keats commented Jul 7, 2019

This should probably go into pulldown-cmark though, there is a related issue for it there: pulldown-cmark/pulldown-cmark#119

@Keats
Copy link
Collaborator

Keats commented Aug 12, 2019

Going to close this as, if this goes in, it will be in pulldown-cmark

@Keats Keats closed this as completed Aug 12, 2019
@nixberg
Copy link

nixberg commented Sep 2, 2020

With v0.8.0, pulldown-cmark supports smart punctuation.

@Keats
Copy link
Collaborator

Keats commented Sep 2, 2020

Yep I will enable it in 0.12 if I have time but otherwise in 0.13

@Keats Keats reopened this Sep 3, 2020
@Keats
Copy link
Collaborator

Keats commented Sep 3, 2020

Re-opening. I'm updating pulldown-cmark to 0.8 in 0.12 but will write the code to add smart ponctuation for 0.13 since I want to make it an option and will add maybe a few more options in the next version.

@dertuxmalwieder
Copy link
Contributor

One of the problems I can see with this is that this partially breaks full i18n support. For example, „German quotation“ is not quite the same thing as “U.S. quotation”.

@ErichDonGubler
Copy link
Contributor

One of the problems I can see with this is that this partially breaks full i18n support. For example, „German quotation“ is not quite the same thing as “U.S. quotation”.

@dertuxmalwieder: I'm confused. The suggested changes here include a processing step to convert "text" into “text”, but AFAICT the only flow currently available for getting the German punctuation you reference via Gutenberg is just using „text” in your content source directly. This means that the German punctuation flow shouldn't change. Am I misunderstanding something?

@dertuxmalwieder
Copy link
Contributor

Well, either all languages must be supported or Zola needs to skip all non-English content files - or else the punctuation will be wrong.

@ErichDonGubler
Copy link
Contributor

ErichDonGubler commented Oct 22, 2020

Well, either all languages must be supported or Zola needs to skip all non-English content files - or else the punctuation will be wrong.

You're making this same assertion that something will break, and that's what I'm trying to dive into/validate -- is this an abstract concern for you, or do you have specific cases in mind where content may be broken?

@dertuxmalwieder
Copy link
Contributor

“Broken” is the wrong word here. It would cause wrong punctuation in most languages, that’s all.

@ErichDonGubler
Copy link
Contributor

“Broken” is the wrong word here. It would cause wrong punctuation in most languages, that’s all.

I guess I use "breakage" in this context because the behavior in question (how content is generated/processed) seems fundamental enough to the function of an SSG that it can/should be considered part of its correctness.

I'm going to assume your concern is abstract (which is fine!). I think it's valid, and I hope it doesn't seem like the validity of your concern is in question. That said, getting concrete cases where smart punctuation might adversely affect users will likely be very beneficial in the discussion you were trying to motivate in how smart punctuation should be integrated, and that's why I wanted to drive the elaboration of those cases.

Keats added a commit that referenced this issue Nov 27, 2020
@Keats
Copy link
Collaborator

Keats commented Nov 27, 2020

This is enabled in the next branch

@Keats Keats added the done in pr Already done in a PR label Nov 27, 2020
@Keats Keats closed this as completed in 59d3d8a Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

5 participants