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

Apostrophes in contractions are not converted to right single quote #39

Open
bryanforbes opened this issue Nov 28, 2019 · 6 comments
Open

Apostrophes in contractions are not converted to right single quote #39

bryanforbes opened this issue Nov 28, 2019 · 6 comments

Comments

@bryanforbes
Copy link

@bryanforbes bryanforbes commented Nov 28, 2019

For the following text:

I'm going to see my mother. She's very nice.

Currently, ' is not converted to ’ for contractions when the typography extension is enabled, but smartypants does. I would expect the output to be:

I’m going to see my mother. She’s very nice.
@bryanforbes bryanforbes changed the title Contractions are not converted to right single quote Apostrophes in contractions are not converted to right single quote Nov 28, 2019
@yuin yuin added the enhancement label Nov 29, 2019
@sungchang-ha

This comment has been minimized.

Copy link

@sungchang-ha sungchang-ha commented Dec 2, 2019

It appears that the single quote (identical to apostrophe in Markdown input) is not converted as intended in the following case.

Source text (note the period at the end):

'sample'.

Expected:

‘sample’.

Actual result:

‘sample'.

Let me know if I should create a separate issue for this.

@yuin

This comment has been minimized.

Copy link
Owner

@yuin yuin commented Dec 3, 2019

@bryanforbes Typographer extension is just a typographer extension is not SmartyPants exntension. Typographer extension does not support your case.

@sungchang-ha I can not reproduce this. 'sample'. is converted to ‘sample’. in my environment.

@sungchang-ha

This comment has been minimized.

Copy link

@sungchang-ha sungchang-ha commented Dec 3, 2019

@yuin I should've provided the test string as-is, which I edited to no avail.

It appears that the combination of inline styles (bold, italic, etc.) and the adjacent punctuation mark causes the issue. Test environment is Goldmark 1.1.8 and the made-up test string is shown below:

  • Markdown: '*en-US*'/'**javascript**', '*sample*'.
  • Expected: &lsquo;<em>en-US</em>&rsquo;/&lsquo;<strong>javascript</strong>&rsquo;, &lsquo;<em>sample<em>&rsquo;.
  • Current: &lsquo;<em>en-US</em>'/'<strong>javascript</strong>', &lsquo;<em>sample</em>'.

Removing either of the inline style or the adjacent punctuation mark makes it rendered as quotes.

@yuin

This comment has been minimized.

Copy link
Owner

@yuin yuin commented Dec 3, 2019

@sungchang-ha Reasonable. Typographer extension is implemented with same algorithm as Emphasis and strong emphasis defined in CommonMark. Left flanking is converted into &lsquo; and Right flanking is converted into &rsquo; . This is a limitation in this algorithm.

I'm not usually writing English, so this functionalities has low priority for me.
I welcome PR with enhancement of typographer.

@yuin yuin added the help wanted label Dec 7, 2019
@bryanforbes

This comment has been minimized.

Copy link
Author

@bryanforbes bryanforbes commented Dec 11, 2019

Typographer extension does not support your case.

Do you mean that converting apostrophes to single right quote will not be supported ever, or that converting them is currently unsupported?

@yuin

This comment has been minimized.

Copy link
Owner

@yuin yuin commented Dec 12, 2019

@bryanforbes Converting them is currently unsupported. As wrote above, I'm not usually writing English and honestly say I never used this functionality.

I do not have so much time for this project, so I'm going to use the time for better supporting CJK environment instead of typographer that I have never used.

I welcome PR that enhances typographer(or adds complete SmartyPants extension).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.