(function() {
function insertDetails(_, summary, details) {
return "" + summary + "
" + details + "
element after and around // otherwise we can't hide the content since we can't target text nodes via CSS return text.replace(/<\/summary>/ig, "\n\n") .replace(/<\/details>/ig, "\n\n\n\n"); } Discourse.Dialect.addPreProcessor(function(text) { if (Discourse.SiteSettings.details_enabled) { text = replaceDetails(text); } return text; }); Discourse.Markdown.whiteListTag("details", "class", "elided"); })();