Open Gers2017 opened 2 years ago
I was trying to imitate dev.to's posts full of emojis and I found this bug
The function does not filter Unicode emojis, which makes next.js unable to pre-render posts correctly due to the post slug
after some googling I found a simple solution to this
let str = "Hi! πΊπΊπΊπΊ Hello tomπ©βππ¨βπ»"; let regex = new RegExp(/\p{Emoji}/gu); console.log(str.replace(regex, ""));
another solution might be the one supplied here Mozilla docs
I was trying to imitate dev.to's posts full of emojis and I found this bug
The function does not filter Unicode emojis, which makes next.js unable to pre-render posts correctly due to the post slug
after some googling I found a simple solution to this
another solution might be the one supplied here Mozilla docs