-
Notifications
You must be signed in to change notification settings - Fork 8
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
Rich text editor | Update dependency on prosemirror-markdown #1526
Merged
Conversation
This file contains 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
vivinkrishna-ni
changed the title
Rich text editor | Update dependency on prosemirror-makrdown
Rich text editor | Update dependency on prosemirror-markdown
Sep 13, 2023
vikisekarNI
approved these changes
Sep 13, 2023
change/@ni-nimble-components-20c7f83a-27bf-4fe3-aeb3-86e15e1561c5.json
Outdated
Show resolved
Hide resolved
jattasNI
approved these changes
Sep 13, 2023
rajsite
approved these changes
Sep 14, 2023
packages/nimble-components/src/rich-text/models/tests/markdown-serializer.spec.ts
Show resolved
Hide resolved
You don't need to wait for @m-akinc's review for a straightforward dependency upgrade. We need additional discussion for tests separate from this PR. |
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.
Pull Request
🤨 Rationale
Fixes Bug 2518928: Rich text editor | Bold italics not updating as expected
In markdown-serializer, if the the markdown string contains leading or trailing whitespaces within marks, it will not parsed to an expected rich text content. For example, entering "Bold Italics bold" into the editor, the actual markdown serializer output is
**Bold *italics *bold**
which renders as below in viewer.Expected output for the above example should be
**Bold *italics* bold**
👩💻 Implementation
Bumped the
prosemirror-markdown
version from1.11.0
to1.11.2
which fixesexpelEnclosingWhitespace
property to expel any leading or trailing whitespaces within a mark to outer nodes.🧪 Testing
markdown-serializer.ts
for different scenarios with the example mentioned above and a few other test cases that cause the leading and trailing whitespace. Please note that the input HTML string given to the tests is the same as how theTiptap
renders bold and italics cases. For example, strong has a higher priority than italics, so the HTML will be like✅ Checklist