PHPackages                             league/commonmark-ext-smartpunct - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. league/commonmark-ext-smartpunct

Abandoned → [league/commonmark](/?search=league%2Fcommonmark)ArchivedCommonmark-extension[Parsing &amp; Serialization](/categories/parsing)

league/commonmark-ext-smartpunct
================================

Intelligently converts ASCII quotes, dashes, and ellipses in Markdown to their Unicode equivalents

v1.2.0(5y ago)745.1k2BSD-3-ClausePHPPHP ^7.1

Since Mar 11Pushed 5y ago3 watchersCompare

[ Source](https://github.com/thephpleague/commonmark-ext-smartpunct)[ Packagist](https://packagist.org/packages/league/commonmark-ext-smartpunct)[ Docs](https://github.com/thephpleague/commonmark-ext-smartpunct)[ GitHub Sponsors](https://github.com/colinodell)[ Patreon](https://www.patreon.com/colinodell)[ RSS](/packages/league-commonmark-ext-smartpunct/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (3)Versions (9)Used By (0)

Smart Punctuation for `league/commonmark`
=========================================

[](#smart-punctuation-for-leaguecommonmark)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6b2e8554d72b144bd7a09340ce57192d848e8d20e8a08ec01ce1562dc29e2e53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65616775652f636f6d6d6f6e6d61726b2d6578742d736d61727470756e63742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/commonmark-ext-smartpunct)[![Software License](https://camo.githubusercontent.com/f4927c28d46f9aff0a32ba934d27da23943c7e31876f86d6362e41a56e9c66ad/687474703a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4253442d2d332d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/831125b1d71dc0c85dd2d0a644be66db7b7ab248cc26d71ec3b744272598ef8d/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468657068706c65616775652f636f6d6d6f6e6d61726b2d6578742d736d61727470756e63742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/thephpleague/commonmark-ext-smartpunct)[![Coverage Status](https://camo.githubusercontent.com/e81adb1a65588d704b2cb3feedf9e8875b3cfc1c1c915f70c9cded615c98f730/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7468657068706c65616775652f636f6d6d6f6e6d61726b2d6578742d736d61727470756e63742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/commonmark-ext-smartpunct/code-structure)[![Quality Score](https://camo.githubusercontent.com/0475bb841823ac400ce424e8280a0e6ae5259d3f050e6b75ceb14ae2f1f20655/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468657068706c65616775652f636f6d6d6f6e6d61726b2d6578742d736d61727470756e63742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thephpleague/commonmark-ext-smartpunct)[![Total Downloads](https://camo.githubusercontent.com/727780bd42b22b827e050193ca961baca281a86df8d4f38fc12b0c0ec06e1e6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f636f6d6d6f6e6d61726b2d6578742d736d61727470756e63742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/commonmark-ext-smartpunct)

DEPRECATED
----------

[](#deprecated)

**This extension has been deprecated**. All of its functionality now exists in [`league/commonmark`](https://github.com/thephpleague/commonmark) 1.3+ under the `League\CommonMark\Extension\SmartPunct` namespace, so you should upgrade to that version and use that bundled extension instead of this one.

Overview
--------

[](#overview)

Intelligently converts ASCII quotes, dashes, and ellipses to their Unicode equivalents. For use with the [`league/commonmark` Markdown parser for PHP](https://github.com/thephpleague/commonmark).

For example, this Markdown...

```
"CommonMark is the PHP League's Markdown parser," she said.  "It's super-configurable... you can even use additional extensions to expand its capabilities -- just like this one!"
```

Will result in this HTML:

```
“CommonMark is the PHP League’s Markdown parser,” she said.  “It’s super-configurable… you can even use additional extensions to expand its capabilities – just like this one!”
```

Install
-------

[](#install)

Via Composer

```
$ composer require league/commonmark-ext-smartpunct
```

Usage
-----

[](#usage)

Extensions can be added to any new `Environment`:

```
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Ext\SmartPunct\SmartPunctExtension;

// Obtain a pre-configured Environment with all the CommonMark parsers/renderers ready-to-go
$environment = Environment::createCommonMarkEnvironment();

// Add this extension
$environment->addExtension(new SmartPunctExtension());

// Set your configuration
$config = [
    'smartpunct' => [
        'double_quote_opener' => '“',
        'double_quote_closer' => '”',
        'single_quote_opener' => '‘',
        'single_quote_closer' => '’',
    ],
];

// Instantiate the converter engine and start converting some Markdown!
$converter = new CommonMarkConverter($config, $environment);
echo $converter->convertToHtml('# Hello World!');
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Colin O'Dell](https://github.com/colinodell)
- [John MacFarlane](https://github.com/jgm)
- [All Contributors](../../contributors)

License
-------

[](#license)

This library is licensed under the BSD-3 license. See the [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 88% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~65 days

Recently: every ~78 days

Total

7

Last Release

2177d ago

Major Versions

v0.2.0 → v1.0.0-beta12019-05-27

PHP version history (2 changes)v0.1.0PHP &gt;=5.6

v0.2.0PHP ^7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/534693?v=4)[Frank de Jonge](/maintainers/frankdejonge)[@frankdejonge](https://github.com/frankdejonge)

![](https://www.gravatar.com/avatar/4325b62a6ad366c731c3120595d861469be50f9da88df3ea99752c30ff98c179?d=identicon)[colinodell](/maintainers/colinodell)

---

Top Contributors

[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (22 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (2 commits)")[![adawolfa](https://avatars.githubusercontent.com/u/92433271?v=4)](https://github.com/adawolfa "adawolfa (1 commits)")

---

Tags

commonmarkcommonmark-extensionmarkdownphpmarkdowncommonmarkextensionpunctuationsmartpunct

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/league-commonmark-ext-smartpunct/health.svg)

```
[![Health](https://phpackages.com/badges/league-commonmark-ext-smartpunct/health.svg)](https://phpackages.com/packages/league-commonmark-ext-smartpunct)
```

###  Alternatives

[zoon/commonmark-ext-youtube-iframe

Extension for league/commonmark to replace youtube link with iframe

12273.1k1](/packages/zoon-commonmark-ext-youtube-iframe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
