-
Notifications
You must be signed in to change notification settings - Fork 290
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
fix: spacing after list in rich text editor [WPB-15685] #18720
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #18720 +/- ##
=======================================
Coverage 45.72% 45.73%
=======================================
Files 944 944
Lines 27872 27876 +4
Branches 6289 6292 +3
=======================================
+ Hits 12745 12748 +3
- Misses 13536 13537 +1
Partials 1591 1591 |
6004ce8
to
a393333
Compare
@@ -27,7 +27,7 @@ import {replaceInRange} from './StringUtil'; | |||
import type {MentionEntity} from '../message/MentionEntity'; | |||
|
|||
interface MentionText { | |||
domain: string | null; | |||
domain: string | null | undefined; |
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.
domain: string | null | undefined; | |
domain?: string | null; |
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.
There was a typescript error for below code.
mentionTexts[mentionKey] = {
domain: mention.domain,
mention.domain
can be undefined.
src/script/util/messageRenderer.ts
Outdated
@@ -99,6 +99,15 @@ markdownit.renderer.rules.paragraph_open = (tokens, idx) => { | |||
.find(({map}) => map?.length); | |||
const previousPosition = previousWithMap ? (previousWithMap.map || [0, 0])[1] - 1 : 0; | |||
const count = position - previousPosition; | |||
|
|||
// Check if the previous token was a list (either bullet or ordered) |
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.
imo this comment is redundant, the code describes itself enough
|
Description
This PR addresses two issues:
domain
property in theMentionText
interface.Changes:
paragraph_open
andparagraph_close
rules inmessageRenderer.ts
to handle empty lines correctly only for lists.<br>
tags for empty lines between paragraphs.MentionText
interface to allowdomain
to be of typestring | null | undefined
.Screenshots/Screencast (for UI changes)
Before
After
Checklist