Abbreviated decade (e.g. ’80s) breaks smart punctuation #1030
Labels
bug
Something isn't working right
spec compliance
Issues or question about compliance with the CommonMark or GFM specs
Version(s) affected
2.4.2
Description
When the
QuoteParser
encounters a string such as:... it seemingly includes the apostrophe before 90 in its calculations, and you end up with a string like:
... where it replaces the already formatted closing single quote before 90 (which is how abbreviated decades should be formatted) with an opening single quote, and then the final double quote ends up as another opening double quote instead of a closing double quote.
I don't know whether the solution lies in the
QuoteParser
being aware of the abbreviated decade format or having the option to instruct it to disregard already formatted quotes or specify it to only format unformatted quotes.I'm migrating a Node-based site that uses
markdown-it
to PHP, andmarkdown-it
handles this situation properly, so there does seem to be a way to interpret this.How to reproduce
I tested this with the
GrahamCampbell/Laravel-Markdown
package as well as usingthephpleague/commonmark
directly, so the problem does seem to lie within this package in either theQuoteParser
orQuoteProcessor
.To reproduce, use any decade abbreviation (e.g.
'60s
unstyled or’70s
styled) in a paragraph with other quoted text. Both will result in the wrong formatting.The text was updated successfully, but these errors were encountered: