Rolled back math tokens

James Peret 7 years ago
parent
commit
98250b2bb0
2 changed files with 11 additions and 9 deletions
  1. 10 9
      index.js
  2. 1 0
      package.json

+ 10 - 9
index.js

@@ -44,6 +44,7 @@ var getPath = function(req){
44 44
   if(req.params['folder_1'] != undefined){
45 45
     path = path + req.params['folder_1'] + "/"
46 46
   }
47
+  return path;
47 48
 }
48 49
 
49 50
 var get_file = function(req, res){
@@ -85,10 +86,10 @@ var markdown_parser = function(data){
85 86
       linkify: true,
86 87
       typographer: true
87 88
     }).use(require('markdown-it-math'), {
88
-      inlineOpen: '$$',
89
-      inlineClose: '$$',
90
-      blockOpen: '$$',
91
-      blockClose: '$$'
89
+      inlineOpen: '\\(',
90
+      inlineClose: '\\)',
91
+      blockOpen: '\\[',
92
+      blockClose: '\\]'
92 93
     }).use(require('markdown-it-highlightjs'), {auto: true, code: false})
93 94
   return md.render(data)
94 95
 }
@@ -99,11 +100,11 @@ var url_paths = [
99 100
   '/:folder_2/:folder_1/:file',
100 101
   '/:folder_3/:folder_2/:folder_1/:file',
101 102
   '/:folder_4/:folder_3/:folder_2/:folder_1/:file',
102
-  '/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file'
103
-  '/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file'
104
-  '/:folder_7/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file'
105
-  '/:folder_8/:folder_7/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file'
106
-  '/:folder_9/:folder_8/:folder_7/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file'
103
+  '/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file',
104
+  '/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file',
105
+  '/:folder_7/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file',
106
+  '/:folder_8/:folder_7/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file',
107
+  '/:folder_9/:folder_8/:folder_7/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file',
107 108
   '/:folder_10/:folder_9/:folder_8/:folder_7/:folder_6/:folder_5/:folder_4/:folder_3/:folder_2/:folder_1/:file'
108 109
 ]
109 110
 

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
16 16
     "codex": "./index.js"
17 17
   },
18 18
   "dependencies": {
19
+    "ascii2mathml": "^0.5.4",
19 20
     "ejs": "^2.5.6",
20 21
     "express": "^4.15.2",
21 22
     "markdown": "^0.5.0",