Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rich text editor | Update dependency on prosemirror-markdown (#1526)
# Pull Request ## 🤨 Rationale <!--- Provide some background and a description of your work. What problem does this change solve? Include links to issues, work items, or other discussions. --> Fixes [Bug 2518928](https://dev.azure.com/ni/DevCentral/_workitems/edit/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. ![image](https://github.com/ni/nimble/assets/123377523/43e3db88-6d79-4027-a457-d8bfea802a56) Expected output for the above example should be `**Bold *italics* bold**` ## 👩💻 Implementation <!--- Describe how the change addresses the problem. Consider factors such as complexity, alternative solutions, performance impact, etc. Consider listing files with important changes or comment on them directly in the pull request. --> Bumped the `prosemirror-markdown` version from `1.11.0` to `1.11.2` which fixes [`expelEnclosingWhitespace`](https://github.com/ProseMirror/prosemirror-markdown/blob/c7210d0e55c82bfb0b2f7cba5dffe804575fafb3/src/to_markdown.ts#L21C3-L21C27) property to expel any leading or trailing whitespaces within a mark to outer nodes. ## 🧪 Testing <!--- Detail the testing done to ensure this submission meets requirements. Include automated/manual test additions or modifications, testing done on a local build, private CI run results, and additional testing not covered by automatic pull request validation. If any functionality is not covered by automated testing, provide justification. --> 1. Manually tested by getting markdown string for different bold and italics mixed cases and loading it in the viewer. 2. Add test cases in the `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 the `Tiptap` renders bold and italics cases. For example, strong has a higher priority than italics, so the HTML will be like 1. Italics between bold (**Bold *italics* bold**): ```html <strong> Bold <em>italics </em> bold </strong> ``` 2. Bold between italics (*Italics **bold** italics*): ```html <em>Italics </em> <strong> <em>bold </em> </strong> <em>italics</em> ``` ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [x] I have updated the project documentation to reflect my changes or determined no changes are needed. --------- Co-authored-by: vikisekarNI <[email protected]>
- Loading branch information