-
Notifications
You must be signed in to change notification settings - Fork 8
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 | Add setMarkdown() and getMarkdown() methods to set…
… and get content from Tip Tap editor (#1424) # Pull Request ## 🤨 Rationale This PR contains logic for parsing the assigned markdown content, setting it to the editor and also serializing the editor's data to markdown content. AzDo Feature: https://dev.azure.com/ni/DevCentral/_backlogs/backlog/ASW%20SystemLink%20LIMS/Features/?workitem=2350963 Issue: #1288 ## 👩💻 Implementation * Exposed getMarkdown() and setmarkdown() methods to facilitate the exchange of data with the editor. * Used MarkdownParser from [prosemirror-markdown](https://github.com/ProseMirror/prosemirror-markdown/tree/master) package for parsing markdown strings, DOM serializer from [prosemirror-model ](https://github.com/ProseMirror/prosemirror-model) package to serialize the content as DOM structure, XML Serializer to serialize it to HTML string and sets it to the editor. * To serialize the tip-tap [document ](https://prosemirror.net/docs/ref/#model.Document_Structure)in getMarkdown() used MarkdownSerializer from [prosemirror-markdown](https://github.com/ProseMirror/prosemirror-markdown/tree/master) package to serialize the node based on schema. * Enabled `emphasis` and `list` rules in MarkdownParser, this allows users to set bold, italics, numbered, and bulleted lists in a CommonMark flavor to the editor. All other basic markdown formats are disabled. * Added only respective nodes and marks for bold, italics, numbered and bulleted lists in `MarkdownSerializer` ## 🧪 Testing * Added unit tests and visual tests for the component. * Manually tested and verified the functionality of the supported features. ## ✅ 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. --------- Signed-off-by: Aagash Raaj <[email protected]> Co-authored-by: SOLITONTECH\vivin.krishna <[email protected]> Co-authored-by: SOLITONTECH\aagash.maridas <[email protected]> Co-authored-by: Jesse Attas <[email protected]>
- Loading branch information
1 parent
51b3fa5
commit 42928b3
Showing
8 changed files
with
1,013 additions
and
33 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@ni-nimble-components-9d517129-f95f-4278-97e4-b2987f9507f4.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "Add setMarkdown and getMarkdown methods in rich-text-editor", | ||
"packageName": "@ni/nimble-components", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
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
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
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
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
Oops, something went wrong.