Browse Source

parsers change for skipping empty line and fix for parsing title

weichen 3 years ago
parent
commit
981a647a49
1 changed files with 6 additions and 2 deletions
  1. 6 2
      backstage/static/js/parsers.js

+ 6 - 2
backstage/static/js/parsers.js

@@ -23,7 +23,7 @@ function parseMd(content) {
       continue;
     }
 
-    if (line.includes('##')) {
+    if (line.includes('###')) {
       parseBlockDiv = true;
       preDataIndex = 0;
       blockCount = blockCount + 1 | 0;
@@ -46,6 +46,10 @@ function parseMd(content) {
         // for skipping space before first title
         continue
       }
+      if (line === ''){
+        // for skipping space
+        continue
+      }
       const preBlockindex = blockCount;
       const ownDataIndex = preDataIndex;
       preDataIndex += 1;
@@ -57,7 +61,7 @@ function parseMd(content) {
 
 const parseTitle = line => {
   var title = '';
-  title = line.replace('## **', '');
+  title = line.replace('### **', '');
   title = title.replace('**', '');
   return title;
 };