feat: Add curly quotes transformation command and context menu option#6317
Conversation
|
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:
We are glad for every improvement that makes its way into the app, so we look forward to collaborating on merging this PR. |
… straight quotes, it is precisely suggested as curved quotes according to specific semantic rules, while the specified curved quotes are preserved.
nathanlesage
left a comment
There was a problem hiding this comment.
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!
…/wyl2003/Zettlr into feature/straight-to-curly-quotes
To make test code more compact by creating a function
To make them more compact.
c122a8c to
ad4b70b
Compare
|
Hi, The PR is ready for your review whenever you have a moment. Let me know if there's anything else needed! |
|
Looks good now — once the tests pass we can merge. Thank you! |
|
Your PR got merged! Welcome to the party! 🔥 |
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
source/common/modules/markdown-editor/commands/transforms/curl-quotes.ts— the core transform functionsource/common/modules/markdown-editor/context-menu/transform-items.ts— added "Curl quotes" to the Transform context menu, placed right after "Straighten quotes"test/transform-selected-text/curl-quotes.spec.ts— unit testsCHANGELOG.md— added entry under UpcomingNo breaking changes.
Additional information
The algorithm reuses the same heuristic as the existing Magic Quotes autocorrect (
handleQuoteinautocorrect.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