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 zero width space when copying email #35557

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ type NextStepEmailRendererProps = {
function NextStepEmailRenderer({tnode}: NextStepEmailRendererProps) {
const styles = useThemeStyles();

return <Text style={[styles.breakWord, styles.textLabelSupporting, styles.textStrong]}>{tnode.data}</Text>;
return (
<Text
nativeID="email-with-break-opportunities"
style={[styles.breakWord, styles.textLabelSupporting, styles.textStrong]}
>
{tnode.data}
</Text>
);
}

NextStepEmailRenderer.displayName = 'NextStepEmailRenderer';
Expand Down
3 changes: 3 additions & 0 deletions src/libs/SelectionScraper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ const replaceNodes = (dom: Node, isChildOfEditorElement: boolean): Node => {
// Encoding HTML chars '< >' in the text, because any HTML will be removed in stripHTML method.
if (dom.type.toString() === 'text' && dom instanceof DataNode) {
data = Str.htmlEncode(dom.data);
if (dom.parent instanceof Element && dom.parent?.attribs?.id === 'email-with-break-opportunities') {
data = data.replaceAll('\u200b', '');
}
} else if (dom instanceof Element) {
domName = dom.name;
if (dom.attribs?.[tagAttribute]) {
Expand Down
Loading