-
Notifications
You must be signed in to change notification settings - Fork 462
š(frontend) prevent duplicate emoji when used as first character in t⦠#1595
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
base: main
Are you sure you want to change the base?
Conversation
5e4f415 to
7ed8ea5
Compare
|
Size Change: +66 B (0%) Total Size: 4.07 MB
|
0f4a14d to
135ea9a
Compare
ā¦itle ensures icon and title are visually distinct in sub-document headers Signed-off-by: Cyril <[email protected]>
135ea9a to
99eb65d
Compare
AntoLC
left a comment
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.
| if (isTopRoot) { | ||
| const sanitizedTitle = updateDocTitle(doc, inputText); | ||
| setTitleDisplay(sanitizedTitle); | ||
| return sanitizedTitle; |
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.
The return does not seem necessary, same here:
docs/src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx
Line 140 in 99eb65d
| return sanitizedTitleWithoutEmoji; |
| const leadingSpacesLength = title.match(/^\s+/)?.[0]?.length ?? 0; | ||
| const trimmedStart = title.slice(leadingSpacesLength); |
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.
| const leadingSpacesLength = title.match(/^\s+/)?.[0]?.length ?? 0; | |
| const trimmedStart = title.slice(leadingSpacesLength); | |
| const trimmedTitle = title.trimStart(); |
| doc, | ||
| emoji ? `${emoji} ${inputText}` : inputText, | ||
| ); | ||
| const { emoji: pastedEmoji } = getEmojiAndTitle(inputText); |
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.
Do we still need the second getEmojiAndTitle under ?

Purpose
Fix duplicated emoji when pasting an emoji at the beginning of a subādoc title. The pasted emoji must stay in the title and must not be turned into the subādoc icon.
issue : 1592
copypasteemojis.mp4
Proposal
getEmojiAndTitle