Spec 0.18 release

Version 0.18 of the spec has been released (release notes).

The reference implementations have been updated to conform.

Several other changes of note:

  • The spec, javascript implementation, and C implementation now all live in separate repositories.
  • The license for the reference implementations has been changed to the 2-clause BSD license.
  • The dingus now uses the ACE editor and provides scroll sync and highlighting of the part of the rendered document corresponding to cursor position in the source.
  • Both implementations now offer an option for “smart punctuation” (straight quotes to curly quotes, -- and --- to en and em- dashes, ... to ellipses).
3 Likes

Will specification for “smart punctuation” be published?

Specifically interesting questions.
When " is converted to open curly quote and when to closed?
Is --- always converted to em-dash?
And so on…

+++ dikmax [Mar 04 15 21:26 ]:

[1]dikmax
March 4

Will specification for “smart punctuation” be published?

It really should be, and the test suite (test/smart_punct.txt in cmark) could be amplified to a spec. But this is not part of official CommonMark syntax at this point, so not part of the main spec.

Specifically interesting questions.
When " is converted to open curly quote and when to closed?

Quotes work much like emphasis markers. We try to pair right-flanking ones with left-flanking ones. Unmatched single quotes are treated as right quotes. This gives good results for, e.g.

'Tis the season to be 'jolly'.

(Most smartypants filters I have seen will incorrectly make the single quote before Tis into a left single quote.)

Is — always converted to em-dash?

Yes. However, note that punctuation that is backslash-escaped will not be made “smart.”

That’s because contractions are a more common use case than unpaired left quotation marks.

+++ zzzzBov [Mar 05 15 05:00 ]:

[1]zzzzBov
March 5
jgm:

(Most smartypants filters I have seen will incorrectly make the
single quote before Tis into a left single quote.)

That’s because contractions are a more common use case than unpaired
left quotation marks.

Sorry, I’m not sure I follow. Yes, contractions are more common, but in contractions you should have a right single quote, whether it occurs inside a word (it’s) or at the beginning (’tis). Left single quote should only be used when you have a matched pair. cmark gets this right, and most others get it wrong, because they don’t try to match quotes.

I just realized I was getting my left and rights confused

both hands make the L

…which makes my previous statement out of place. Please ignore it.

1 Like