feat: save as markdown behaviour for web#472
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #472 +/- ##
==========================================
+ Coverage 80.32% 80.45% +0.13%
==========================================
Files 188 189 +1
Lines 11151 11160 +9
Branches 1077 1082 +5
==========================================
+ Hits 8957 8979 +22
+ Misses 2180 2167 -13
Partials 14 14
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
cguedes
commented
Sep 1, 2023
| ); | ||
| } | ||
|
|
||
| export async function saveAsMarkdown(markdownSerializer: MarkdownSerializer, filePath: string) { |
Collaborator
Author
There was a problem hiding this comment.
I've moved this file here as he depends in the markdownSerializer that belong to the "text editor".
I've also simplified the code by using the new getFileNameAndExtension.
Collaborator
Author
There was a problem hiding this comment.
After our chat I moved this to own file in src/features/textEditor
| children: undefined, | ||
| })); | ||
|
|
||
| const exportsFiles = relativePaths |
Collaborator
Author
There was a problem hiding this comment.
I've added this support while we don't have #414 ready.
|
|
||
| useEventListener('unhandledrejection', (event) => { | ||
| notifyError('An error occurred', `Unhandled rejection in promise. Reason: ${event.reason}).`); | ||
| notifyError('Unhandled rejection in promise', `Reason: ${event.reason}`); |
Collaborator
Author
There was a problem hiding this comment.
Improve this a bit further.
sehyod
requested changes
Sep 1, 2023
sehyod
approved these changes
Sep 1, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #455 by implementing the same codebase for desktop and web, saving the files (markdown, and optionally the .bib) in the exports folder inside the project.
We can't add the operation to the explorer context menu because we can't ensure that the entry is hidden/inactive for other file types (pdf, .md), and also the current codebase exports the active editor (has a dependency on the TipTap editor instance)