Skip to content

feat(comark): add punctuation plugin#123

Merged
farnabaz merged 5 commits into
comarkdown:mainfrom
arashsheyda:feat/punctuations
Apr 16, 2026
Merged

feat(comark): add punctuation plugin#123
farnabaz merged 5 commits into
comarkdown:mainfrom
arashsheyda:feat/punctuations

Conversation

@arashsheyda

@arashsheyda arashsheyda commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

closes #108

this PR adds a new punctuation plugin that transforms common plain-text punctuation patterns into their typographically correct Unicode characters in a single O(n) pass with no regex

"text" => \u201Ctext\u201D (smart double quotes)
'text' => \u2018text\u2019 (smart single quotes)
don't => don\u2019t (apostrophe)
-- => \u2013 (en-dash)
--- => \u2014 (em-dash)
... => \u2026 (ellipsis)
+- => \u00B1
(c)(r)(tm) => \u00A9 \u00AE \u2122

this would be the first irritation, we can improve and add more features:

  • fractions: 1/2 becomes ½
  • localization
    • for example French has different rules I believe "Bonjour" becomes « Bonjour » @atinux is that right?
    • or Persian: we could convert the numbers, or the Zero-Width Non-Joiner or ك to ک

Screenshot 2026-04-14 at 8 43 26 PM

@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

@arashsheyda is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Apr 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark

npm i https://pkg.pr.new/comarkdown/comark@123

@comark/ansi

npm i https://pkg.pr.new/comarkdown/comark/@comark/ansi@123

@comark/html

npm i https://pkg.pr.new/comarkdown/comark/@comark/html@123

@comark/nuxt

npm i https://pkg.pr.new/comarkdown/comark/@comark/nuxt@123

@comark/react

npm i https://pkg.pr.new/comarkdown/comark/@comark/react@123

@comark/svelte

npm i https://pkg.pr.new/comarkdown/comark/@comark/svelte@123

@comark/vue

npm i https://pkg.pr.new/comarkdown/comark/@comark/vue@123

commit: 5dbe1e6

Comment thread packages/comark/src/plugins/punctuation.ts
@arashsheyda arashsheyda marked this pull request as ready for review April 15, 2026 02:42
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comark Ready Ready Preview Apr 16, 2026 1:28pm

@farnabaz

Copy link
Copy Markdown
Collaborator

Great 👍
Thanks for the PR, I was just thinking that it would be better in docs to show the replacements too

Smart quotes: "text" → ” text\u201D,” 'text' → \u2018text\u2019
                                                ^---- we show rendered version too
Dashes: -- → \u2013 (en-dash), --- → \u2014 (em-dash)
Ellipsis: ... → \u2026
Symbols: (c) → \u00A9, (r) → \u00AE, (tm) → \u2122, +- → \u00B1
Screenshot 2026-04-15 at 14 12 59

And here:
Screenshot 2026-04-15 at 14 13 32

WDYT?

@arashsheyda

Copy link
Copy Markdown
Collaborator Author

updated

@farnabaz farnabaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@farnabaz farnabaz merged commit 9b76e11 into comarkdown:main Apr 16, 2026
4 of 10 checks passed
@arashsheyda arashsheyda deleted the feat/punctuations branch April 16, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Punctuations Plugin

2 participants