diff --git a/app/assets/javascripts/discourse/lib/markdown.js b/app/assets/javascripts/discourse/lib/markdown.js index 1f9ab3cd369..cee428cad32 100644 --- a/app/assets/javascripts/discourse/lib/markdown.js +++ b/app/assets/javascripts/discourse/lib/markdown.js @@ -28,7 +28,7 @@ function validateAttribute(tagName, attribName, value) { // data-* attributes if (tag) { var allowed = tag[attribName] || tag['data-*']; - if (allowed === value || allowed.indexOf('*') !== -1) { return value; } + if (allowed && (allowed === value || allowed.indexOf('*') !== -1)) { return value; } } }