feat(editor): add "Copy as Markdown" option in context & export menus (#14705)

- Allow users to select text and copy it as Markdown via the context
menu
- Add "Copy as Markdown" under Export menu to copy entire document to
clipboard

Fixes #12983

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added "Copy as Markdown" to the toolbar clipboard More menu for
selected content.
* Added "Copy as Markdown" to the page export menu to copy entire pages
as Markdown.

* **Behavior**
* Export flow now returns success/failure so the UI shows a dedicated
success or error notification for clipboard exports.

* **Localization**
  * Added strings for "Copy as Markdown" and "Copied as Markdown".
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Whitewater <me@waterwater.moe>
Co-authored-by: lawvs <18554747+lawvs@users.noreply.github.com>
This commit is contained in:
Saurabh Pardeshi
2026-04-18 18:09:20 +05:30
committed by GitHub
parent f7d0f1d5ae
commit 0009f91d2a
7 changed files with 254 additions and 23 deletions
@@ -21,6 +21,6 @@
"sv-SE": 96,
"uk": 96,
"ur": 2,
"zh-Hans": 98,
"zh-Hans": 97,
"zh-Hant": 96
}
+8
View File
@@ -1822,6 +1822,14 @@ export function useAFFiNEI18N(): {
* `Image copy failed`
*/
["com.affine.copy.asImage.failed"](): string;
/**
* `Copy as Markdown`
*/
["com.affine.export.copy-markdown"](): string;
/**
* `Copied as Markdown`
*/
["com.affine.export.copied-as-markdown"](): string;
/**
* `Cancel`
*/
@@ -449,6 +449,8 @@
"com.affine.copy.asImage.notAvailable.action": "Download Client",
"com.affine.copy.asImage.success": "Image copied",
"com.affine.copy.asImage.failed": "Image copy failed",
"com.affine.export.copy-markdown": "Copy as Markdown",
"com.affine.export.copied-as-markdown": "Copied as Markdown",
"com.affine.confirmModal.button.cancel": "Cancel",
"com.affine.confirmModal.button.ok": "Ok",
"com.affine.currentYear": "Current year",