Commit 919afb46 authored by NGPixel's avatar NGPixel Committed by Nicolas Giard

feat: Optional linebreaks + mathjax processing

parent 3d9aa18c
......@@ -135,6 +135,15 @@ git:
showUserEmail: true
# ---------------------------------------------------------------------
# Features
# ---------------------------------------------------------------------
# You can enable / disable specific features below
features:
linebreaks: true
mathjax: true
# ---------------------------------------------------------------------
# External Logging
# ---------------------------------------------------------------------
......
......@@ -133,6 +133,15 @@ git:
showUserEmail: true
# ---------------------------------------------------------------------
# Features
# ---------------------------------------------------------------------
# You can enable / disable specific features below
features:
linebreaks: true
mathjax: true
# ---------------------------------------------------------------------
# External Logging
# ---------------------------------------------------------------------
......
......@@ -133,6 +133,15 @@ git:
showUserEmail: $(WIKI_SHOW_USER_EMAIL)
# ---------------------------------------------------------------------
# Features
# ---------------------------------------------------------------------
# You can enable / disable specific features below
features:
linebreaks: true
mathjax: true
# ---------------------------------------------------------------------
# External Logging
# ---------------------------------------------------------------------
......
......@@ -49,6 +49,7 @@ defaults:
serverEmail: wiki@example.com
showUserEmail: true
features:
linebreaks: true
mathjax: true
externalLogging:
bugsnap: false
......
......@@ -21,6 +21,7 @@ const mdRemove = require('remove-markdown')
var mkdown = md({
html: true,
breaks: appconfig.features.linebreaks,
linkify: true,
typography: true,
highlight(str, lang) {
......@@ -53,7 +54,10 @@ var mkdown = md({
tabWidth: 4
})
.use(mdAttrs)
.use(mdMathjax)
if (appconfig.features.mathjax) {
mkdown.use(mdMathjax)
}
// Rendering rules
......@@ -296,7 +300,11 @@ const parseContent = (content) => {
// Mathjax Post-processor
return processMathjax(cr.html())
if (appconfig.features.mathjax) {
return processMathjax(cr.html())
} else {
return Promise.resolve(cr.html())
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment