-
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 | Added HardBreak extension in editor for force line break (<br> tag) #1517
Conversation
packages/nimble-components/src/rich-text/editor/testing/rich-text-editor.pageobject.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/models/tests/markdown-parser.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/models/tests/markdown-serializer.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/editor/tests/rich-text-editor.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/editor/tests/rich-text-editor.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/editor/tests/rich-text-editor.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/editor/tests/rich-text-editor.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/models/tests/markdown-parser.spec.ts
Outdated
Show resolved
Hide resolved
…/editor-newline-spacing
As a reminder, please create the PR in draft mode and let a buddy (me) review before publishing and adding owners. |
packages/nimble-components/src/rich-text/editor/tests/rich-text-editor.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/models/tests/markdown-serializer.spec.ts
Outdated
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/editor/tests/rich-text-editor.spec.ts
Show resolved
Hide resolved
packages/nimble-components/src/rich-text/editor/testing/rich-text-editor.pageobject.ts
Outdated
Show resolved
Hide resolved
You can bypass me for this review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting to see results of test changes
…/editor-newline-spacing
Hi @rajsite , I hope you are waiting for Mert's test change comments to be addressed, please let us know if you have any other concerns. I have addressed all the comments that Mert mentioned. |
Can bypass @mollykreis and @atmgrifter00, so ready to merge! |
Pull Request
🤨 Rationale
Fix for Bug 2516897: Switching to a new line by pressing enter adds more spaces than expected.
Paragraph tag
which has more space than expected between lines.Shift/Ctrl/Cmd + Enter
which will make minimal space between lines by adding<br> tag
instead ofParagraph Tag
.👩💻 Implementation
HardBreak
node in Tiptap Editor.newline
andescape
rules in MarkdownIt forRichTextMarkdownParser
to parse the HardBreak markdown syntax as per CommonMark Spec to<br> tag
.hardBreak
node toRichTextMarkdownSerializer
to serialize the<br> tag
to respective hard break markdown syntax.prosemirror-markdown
, it serializes the<br>
tag to backslash with line ending syntax as per the CommonMark Spec example 633.In Windows
Shift/Ctrl+ Enter
and in MacCmd + Enter
will switch to a new line (line break).We are not exposing any format buttons to add line breaks (Hard Break), The only way to break the line is by using the Keys mentioned above.
🧪 Testing
✅ Checklist