-
Notifications
You must be signed in to change notification settings - Fork 72
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
Remove splitting ranges on emojis on the web #598
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,13 +252,16 @@ function parseExpensiMark(markdown: string): MarkdownRange[] { | |
); | ||
return []; | ||
} | ||
const sortedRanges = sortRanges(ranges); | ||
let markdownRanges = sortedRanges; | ||
if (Platform.OS === 'android') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since const isAndroid = Platform.OS === 'android';
function parseExpensiMark(...) {
if (isAndroid) { /* ... */ }
} |
||
// Blocks applying italic and strikethrough styles to emojis on Android | ||
// TODO: Remove this condition when splitting emojis inside the inline code block will be fixed on the web | ||
markdownRanges = splitRangesOnEmojis(markdownRanges, 'italic'); | ||
Skalakid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
markdownRanges = splitRangesOnEmojis(markdownRanges, 'strikethrough'); | ||
} | ||
|
||
let splittedRanges = splitRangesOnEmojis(ranges, 'italic'); | ||
splittedRanges = splitRangesOnEmojis(splittedRanges, 'strikethrough'); | ||
|
||
const sortedRanges = sortRanges(splittedRanges); | ||
const groupedRanges = groupRanges(sortedRanges); | ||
|
||
const groupedRanges = groupRanges(markdownRanges); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe do the sorting again here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need it here. Sorting influences only the web and since we blocked spitting ranges for this platform, the output will still be correctly sorted |
||
return groupedRanges; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -26,7 +26,13 @@ function addStyleToBlock(targetElement: HTMLElement, type: NodeType, markdownSty | |||||||||
node.style.textDecoration = 'line-through'; | ||||||||||
break; | ||||||||||
case 'emoji': | ||||||||||
Object.assign(node.style, {...markdownStyle.emoji, verticalAlign: 'middle'}); | ||||||||||
Object.assign(node.style, { | ||||||||||
...markdownStyle.emoji, | ||||||||||
verticalAlign: 'middle', | ||||||||||
fontStyle: 'normal', | ||||||||||
textDecoration: 'none', | ||||||||||
Comment on lines
+32
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
display: 'inline-block', | ||||||||||
}); | ||||||||||
break; | ||||||||||
case 'mention-here': | ||||||||||
Object.assign(node.style, markdownStyle.mentionHere); | ||||||||||
|
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.