BUGFIX: markdown sanitize on null/undefined text
This commit is contained in:
parent
06a87fb0ee
commit
c97de2c449
|
@ -160,7 +160,7 @@ Discourse.Markdown = {
|
|||
@return {String} text The sanitized text
|
||||
**/
|
||||
sanitize: function(text) {
|
||||
if (!window.html_sanitize) return "";
|
||||
if (!window.html_sanitize || !text) return "";
|
||||
text = text.replace(/<([^A-Za-z\/]|$)/g, "<$1");
|
||||
return window.html_sanitize(text, Discourse.Markdown.urlAllowed, Discourse.Markdown.nameIdClassAllowed);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue