mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Pass the full CommonMark spec
This commit is contained in:
@@ -213,7 +213,7 @@ export function setup(opts, siteSettings, state) {
|
||||
html: true,
|
||||
breaks: opts.discourse.features.newline,
|
||||
xhtmlOut: false,
|
||||
linkify: true,
|
||||
linkify: opts.discourse.features.linkify,
|
||||
typographer: siteSettings.enable_markdown_typographer
|
||||
});
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -21,7 +21,8 @@ export function buildOptions(state) {
|
||||
lookupAvatarByPostNumber,
|
||||
emojiUnicodeReplacer,
|
||||
lookupInlineOnebox,
|
||||
previewing
|
||||
previewing,
|
||||
linkify
|
||||
} = state;
|
||||
|
||||
let features = {
|
||||
@@ -33,6 +34,7 @@ export function buildOptions(state) {
|
||||
'html': true,
|
||||
'category-hashtag': true,
|
||||
'onebox': true,
|
||||
'linkify': linkify !== false,
|
||||
'newline': !siteSettings.traditional_markdown_linebreaks
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user