fix: Display Plain Text for Card Content in Collection List#94
Open
pjbruijne wants to merge 1 commit into0010aor:mainfrom
Open
fix: Display Plain Text for Card Content in Collection List#94pjbruijne wants to merge 1 commit into0010aor:mainfrom
pjbruijne wants to merge 1 commit into0010aor:mainfrom
Conversation
By replacing the call to editor?.storage.markdown.getMarkdown() with a call to editor?.getHTML(), the creation of a new card is now inline with the update of a card. This also fixes the issue of a preview containing markdown characters instead of plaintext.
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.
Fixes #54.
Based on observations of the issue, it appeared to stem from a disparity between the saving process for creating and updating. If a new file was saved, the markdown symbols were shown in the preview. If a file was updated, even if nothing was changed to the rich text, the preview correctly showed as plain text. Investigating the indexedDB revealed that the stored string differed between the initial save and an update, even if the update appeared to do nothing to the card. This could be traced back to the calling of the function
saveCard. Thus, by replacing the call toeditor?.storage.markdown.getMarkdown()with a call toeditor?.getHTML(), as it was done inupdateCard, the creation of a new card is now in line with the update of a card, which fixes the issue of a preview containing markdown characters. Since the change happens at a point before the retrieval of the selected repository throughrepo(), this change will fix it for both the offline database (indexedDB) as well as the online database (backend + postgre).With the fix, the collection's card preview now aligns with the expected behavior as specified in #54: