Skip to content

feat: Add curly quotes transformation command and context menu option#6317

Merged
nathanlesage merged 20 commits into
Zettlr:developfrom
wyl2003:feature/straight-to-curly-quotes
May 13, 2026
Merged

feat: Add curly quotes transformation command and context menu option#6317
nathanlesage merged 20 commits into
Zettlr:developfrom
wyl2003:feature/straight-to-curly-quotes

Conversation

@wyl2003

@wyl2003 wyl2003 commented May 1, 2026

Copy link
Copy Markdown
Contributor

Description

Add a "Curl quotes" text transform — the inverse of the existing "Straighten quotes" — that converts straight quotes (" and ') to curly (smart) quotes based on the user's configured Magic Quotes settings.

Closes #6259

Changes

  • New file: source/common/modules/markdown-editor/commands/transforms/curl-quotes.ts — the core transform function
  • Modified: source/common/modules/markdown-editor/context-menu/transform-items.ts — added "Curl quotes" to the Transform context menu, placed right after "Straighten quotes"
  • New file: test/transform-selected-text/curl-quotes.spec.ts — unit tests
  • Modified: CHANGELOG.md — added entry under Upcoming

No breaking changes.

Additional information

The algorithm reuses the same heuristic as the existing Magic Quotes autocorrect (handleQuote in autocorrect.ts): a quote preceded by a space, opening bracket, dash, or start-of-text becomes an opening quote; otherwise it becomes a closing quote. This ensures consistent behavior between typing and bulk-converting.

Tested on: Windows 11

@boring-cyborg

boring-cyborg Bot commented May 1, 2026

Copy link
Copy Markdown

Thank you for opening your first PR! 🎉 We would like to thank you already for your contribution. If everything checks out, we'll make sure to review the PR as soon as possible and give feedback. Please note a few things:

  • For every PR, the automated pipeline will run the linter and unit tests on
    your code. Should these fail, we will not merge your PR.
  • Activate your notifications and check your inbox regularly to respond to our
    reviews and/or comments.

We are glad for every improvement that makes its way into the app, so we look forward to collaborating on merging this PR.

monryouth added 3 commits May 1, 2026 13:29
… straight quotes, it is precisely suggested as curved quotes according to specific semantic rules, while the specified curved quotes are preserved.
@wyl2003 wyl2003 marked this pull request as ready for review May 1, 2026 05:43

@nathanlesage nathanlesage left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi! Thank you so much for providing this PR. From what I've seen, this does what it says on the tin, which is great. However, there are few things here and there that I'd love you to address.

If you have any questions or concerns, just let me know!

Comment thread source/common/modules/markdown-editor/commands/transforms/curl-quotes.ts Outdated
Comment thread source/common/modules/markdown-editor/context-menu/transform-items.ts Outdated
Comment thread test/transform-selected-text/curl-quotes.spec.ts
@wyl2003 wyl2003 requested a review from nathanlesage May 4, 2026 02:49
@wanzy147 wanzy147 force-pushed the feature/straight-to-curly-quotes branch from c122a8c to ad4b70b Compare May 9, 2026 15:43
@wyl2003

wyl2003 commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi,
Thank you again for all the helpful feedback! Just wanted to give you a quick ping that all the requested changes have been implemented.

The PR is ready for your review whenever you have a moment. Let me know if there's anything else needed!

@nathanlesage

Copy link
Copy Markdown
Member

Looks good now — once the tests pass we can merge. Thank you!

@nathanlesage nathanlesage merged commit 6ab21cc into Zettlr:develop May 13, 2026
1 of 2 checks passed
@boring-cyborg

boring-cyborg Bot commented May 13, 2026

Copy link
Copy Markdown

Your PR got merged! Welcome to the party! 🔥

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.

Straight quotes to curly quotes and vice versa

4 participants