Sometimes quill editor show '?' in the display

22 Views Asked by At

While creating template in quill editor sometime it shows ? in the display of content.i think its due to space, or might be something else.Suggest some ideas to resolved it.Its generate randomly

sample image that shows error

1

There are 1 best solutions below

0
RIshi Kapadia On

Remove Zero Width Character String before passing to API

export const removeZeroWidthCharacters = (str = '') => {
    return str.replace(/[\u200B-\u200D\uFEFF]/g, '')
}

ex: const str = "ABCD EFGH"

that space contains maybe zero width characters(uFEFF)

So this method will remove white-space characters
    const finalString = removeZeroWidthCharacters(str)
    console.log(finalString) // ABCDEFGH