Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in serializePlainText #2730

Merged
merged 3 commits into from Jul 19, 2022
Merged

Fix typo in serializePlainText #2730

merged 3 commits into from Jul 19, 2022

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jul 19, 2022

Summary

  1. Added txt to plaintext mapping to prevent the console to be spammed with missing mapping messages when opening a bunch of txt files.
  2. Fixed a typo in serializePlainText as the TipTap v2 type name of a code block is codeBlock not code_block, this prevents issues with empty non-markdown files.

Ref.: https://github.com/ueberdosis/tiptap/blob/main/docs/overview/upgrade-guide.md#new-names-for-most-extensions

This reduces the console output as everytime a txt file is loaded
a exception is printed out that no matching language mapping is found
for txt.

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
An empty text file should be serialized as `''` so fix
checking if the document only contains an empty code block
which type is `codeBlock` on tiptap v2 not `code_block`.

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
@vinicius73
Copy link
Member

/compile

@vinicius73
Copy link
Member

/backport to stable24

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Copy link
Member

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

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

Nice catch

@juliushaertl juliushaertl merged commit 7966745 into master Jul 19, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/plaintext branch July 19, 2022 15:04
@backportbot-nextcloud
Copy link

The backport to stable24 failed. Please do this backport manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants