2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

Pass the full CommonMark spec

This commit is contained in:
Sam 2017-07-21 13:20:45 -04:00
parent aa5b8a5749
commit e1ce47a901
6 changed files with 84 additions and 69 deletions

View file

@ -13,7 +13,7 @@ function render(tokens, idx, options, env, slf, md) {
if (info) {
// strip off any additional languages
info = info.split(/\s+/g)[0];
info = info.trim().split(/\s+/g)[0];
}
const acceptableCodeClasses = md.options.discourse.acceptableCodeClasses;
@ -23,7 +23,7 @@ function render(tokens, idx, options, env, slf, md) {
className = TEXT_CODE_CLASSES.indexOf(info) !== -1 ? 'lang-nohighlight' : 'lang-' + langName;
return `<pre><code class='${className}'>${escapedContent}</code></pre>\n`;
return `<pre><code class="${className}">${escapedContent}</code></pre>\n`;
}
export function setup(helper) {