Closed nuclearspike closed 6 years ago
Ah an edge case. Love a good edge case. Thanks for reporting this. I'll get it fixed soon. 😊
Just published a new version with this fix:0.1.6
🎉
Excellent! Thanks for the lightning fast turnaround!
No worries. Thanks for the super detailed bug report that made it nearly effortless to fix 😊
I'm not sure exactly what caused it, but I kind of wonder if a change to Chrome caused this because all of this code used to work perfectly for us. But now when users paste in text from an email, it keeps inline styles that aren't in the default style dict and this package's code doesn't know how to handle that. It'll post inline styles of rgb(192,blah,blah) and background colors when the only ones in the dict are BOLD and ITALIC.
The problem happens in the package code here:
Since currentStyle.style is either some rgb value or background color, those are not listed in the markdownDict so ".length" is being called on an undefined value.
My temporary work-around to is to just remove anything not in the default dict.
And this fixed it for now. The package needs to be able to just ignore any styles it doesn't recognize.