diff --git a/src/core/components/providers/markdown.jsx b/src/core/components/providers/markdown.jsx
index d058d17617f..8ebce12c0c0 100644
--- a/src/core/components/providers/markdown.jsx
+++ b/src/core/components/providers/markdown.jsx
@@ -11,6 +11,12 @@ const sanitizeOptions = {
function Markdown({ source }) {
const sanitized = sanitize(source, sanitizeOptions)
+
+ // sometimes the sanitizer returns "undefined" as a string
+ if(!source || !sanitized || sanitized === "undefined") {
+ return null
+ }
+
return )
+
+ expect(el.text()).toEqual("")
+ })
+
+ it("should return no text for `undefined` as source input", function(){
+ let props = {
+ source: undefined
+ }
+
+ let el = render()
+
+ expect(el.text()).toEqual("")
+ })
+
+ it("should return no text for empty string as source input", function(){
+ let props = {
+ source: ""
+ }
+
+ let el = render()
+
+ expect(el.text()).toEqual("")
+ })
+})