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

Rich text editor | Update dependency on prosemirror-markdown #1526

Merged
merged 7 commits into from
Sep 14, 2023

Conversation

vivinkrishna-ni
Copy link
Contributor

@vivinkrishna-ni vivinkrishna-ni commented Sep 13, 2023

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.
image

Expected output for the above example should be **Bold *italics* bold**

👩‍💻 Implementation

Bumped the prosemirror-markdown version from 1.11.0 to 1.11.2 which fixes expelEnclosingWhitespace property to expel any leading or trailing whitespaces within a mark to outer nodes.

🧪 Testing

  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):
      <strong>
          Bold 
          <em>italics </em>
          bold
      </strong>
    2. Bold between italics (Italics bold italics):
      <em>Italics </em>
      <strong>
           <em>bold </em>
      </strong>
      <em>italics</em>

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@vivinkrishna-ni vivinkrishna-ni changed the title Rich text editor | Update dependency on prosemirror-makrdown Rich text editor | Update dependency on prosemirror-markdown Sep 13, 2023
@vivinkrishna-ni vivinkrishna-ni marked this pull request as ready for review September 13, 2023 10:11
@rajsite
Copy link
Member

rajsite commented Sep 14, 2023

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.

@vivinkrishna-ni vivinkrishna-ni merged commit e505291 into main Sep 14, 2023
6 checks passed
@vivinkrishna-ni vivinkrishna-ni deleted the users/vivin/fix-bold-italics-mix branch September 14, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants