HubSpot / draft-convert

Extensibly serialize & deserialize Draft.js ContentState with HTML.
Apache License 2.0
484 stars 94 forks source link

Empty space in block text brakes rendering #91

Open harlandjp opened 7 years ago

harlandjp commented 7 years ago

Hi guys

Having "text": " " in a block (Empty space in the value), makes convertToHTML method return empty on version 1.4.9.

Example block data below:

{
    "data" : {},
    "entityRanges" : [ 
        {
            "key" : 0,
            "length" : 1,
            "offset" : 0
        }
    ],
    "inlineStyleRanges" : [],
    "depth" : 0,
    "type" : "unstyled",
    "text" : " ",
    "key" : "6k1g"
}, 

This didn't happen on prior versions. Any ideas?

benbriggs commented 6 years ago

Can you elaborate a bit more on what precisely you're seeing? By breaking rendering do you mean an exception being thrown? An example test asserting an expected output would be helpful.