aboutsummaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-11-25 23:28:37 +0100
committerache <ache@ache.one>2017-11-25 23:28:37 +0100
commit24ceb94d00ffed05b8488fb75db89aaec8fcbedb (patch)
treea514d72e6d07230fb02fee74bfab9959dab27378 /app.js
parentUpdate MathJax script (diff)
Update everything
Diffstat (limited to 'app.js')
-rw-r--r--app.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/app.js b/app.js
index f54770c..745c896 100644
--- a/app.js
+++ b/app.js
@@ -22,6 +22,8 @@ const kbd = require('remark-kbd');
const math = require('remark-math');
const mermaid = require('remark-mermaid-simple');
const highlight = require('remark-highlight.js');
+const sb = require('remark-special-box');
+const qcm = require('remark-qcm');
const useLandScript = " <script> mermaid.contentLoaded(); </script>"
@@ -39,6 +41,8 @@ app.get('/' + path + '/*', function(req, res) {
.use(kbd)
.use(math)
.use(mermaid)
+ .use(sb)
+ .use(qcm)
.use(highlight)
.use(html)
.process(data, function (err, file) {
@@ -56,9 +60,20 @@ app.get('/data', function(req, res) {
app.get('/img/*', function (req, res) {
console.log("[" + new Date() + "] > " + "200 - " + req.url);
- var img = fs.readFileSync(req.url.replace('/img', path));
- res.writeHead(200, {'Content-Type': 'image/gif' });
- res.end(img, 'binary');
+ if( path == '/img/ic_info_black_48px.svg' ||
+ path == '/imr/ic_error_black_48px.svg' ||
+ path == '/imr/ic_good_black_48px.svg' ||
+ path == '/imr/ic_bad_black_48px.svg' ||
+ path == '/imr/ic_comment_black_48px.svg' ||
+ path == '/imr/ic_help_black_48px.svg' ) {
+ const img = fs.readFileSync(path);
+ res.writeHead(200, {'Content-Type': 'image/svg' });
+ res.end(img, 'binary');
+ }else {
+ const img = fs.readFileSync(req.url.replace('/img', path));
+ res.writeHead(200, {'Content-Type': 'image/gif' });
+ res.end(img, 'binary');
+ }
});
app.get('/', function(req, res) {