Skip to content
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

Merged
merged 6 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/parseExpensiMark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,16 @@ function parseExpensiMark(markdown: string): MarkdownRange[] {
);
return [];
}
const sortedRanges = sortRanges(ranges);
let markdownRanges = sortedRanges;
Skalakid marked this conversation as resolved.
Show resolved Hide resolved
if (Platform.OS === 'android') {
Skalakid marked this conversation as resolved.
Show resolved Hide resolved
// 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);
Skalakid marked this conversation as resolved.
Show resolved Hide resolved
return groupedRanges;
}

Expand Down
8 changes: 7 additions & 1 deletion src/web/utils/blockUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Skalakid marked this conversation as resolved.
Show resolved Hide resolved
display: 'inline-block',
});
break;
case 'mention-here':
Object.assign(node.style, markdownStyle.mentionHere);
Expand Down
Loading