diegomura / diegomura/react-pdf

ZWSP not working

Open
#1,760 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

Hi!,

I am trying to add ZWSP.

Following is the Code:

`Font.register({
family: 'Roboto',
src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-light-webfont.ttf',
});

const styles = StyleSheet.create({
page: { padding: 60 },
row: {
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
fontSize: 8,
height: 24,
fontStyle: 'bold',
},
cell:{
width: '33%',textAlign: 'center',
borderRightColor: '#ab1e2f',
borderRightWidth: 1,
paddingLeft: 8,
},
});

const doc = (





aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


bbbbb


ccc



);

ReactPDF.render(doc);
`
Result:
![image](https://user-images.githubusercontent.com/83274089/160386875-e3817be1-6b58-4674-a004-ebc71e5b2def.png)

Code With ZWSP (using ​ )
`
aaaaaaaaaaaa​aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
`
Result:
![image](https://user-images.githubusercontent.com/83274089/160388039-53198312-a9dc-4197-a537-095121c1464f.png)

Code With ZWSP (using '\u200B')
`
{'aaaaaaaaaaaa\u200Beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'}
`
Result:
![image](https://user-images.githubusercontent.com/83274089/160388318-96ed3c90-66fe-4746-9d22-5490c1ee1ac1.png)

Expected result is to break line.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.