Browse Source

chore: bump mldoc

Tienson Qin 4 years ago
parent
commit
b0a0e4d811
3 changed files with 11 additions and 7 deletions
  1. 1 1
      package.json
  2. 6 2
      src/main/frontend/modules/file/core.cljs
  3. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -73,7 +73,7 @@
         "ignore": "^5.1.8",
         "is-svg": "4.2.2",
         "jszip": "^3.5.0",
-        "mldoc": "0.6.15",
+        "mldoc": "0.6.16",
         "path": "^0.12.7",
         "react": "^17.0.1",
         "react-dom": "^17.0.1",

+ 6 - 2
src/main/frontend/modules/file/core.cljs

@@ -25,7 +25,8 @@
   (let [content (or content "")
         heading-with-title? (seq title)
         first-block? (= left page)
-        pre-block? (and first-block? pre-block?)]
+        pre-block? (and first-block? pre-block?)
+        markdown-heading? (and (= format :markdown) (not unordered) (not heading-to-list?))]
     (cond
       (and first-block? pre-block?)
       (let [content (-> (string/trim content)
@@ -41,7 +42,7 @@
                 (repeat level "*")
                 (apply str)) ""]
 
-              (and (= format :markdown) (not unordered) (not heading-to-list?)) ; heading
+              markdown-heading?
               ["" ""]
 
               :else
@@ -60,6 +61,9 @@
                       content)
             new-content (indented-block-content (string/trim content) spaces-tabs)
             sep (cond
+                  markdown-heading?
+                  ""
+
                   heading-with-title?
                   " "
 

+ 4 - 4
yarn.lock

@@ -3853,10 +3853,10 @@ mkdirp@^0.5.4, mkdirp@~0.5.1:
   dependencies:
     minimist "^1.2.5"
 
[email protected]5:
-  version "0.6.15"
-  resolved "https://registry.yarnpkg.com/mldoc/-/mldoc-0.6.15.tgz#136a5a27ca104f275ddb2de7fadc2e1c6dcae14f"
-  integrity sha512-AxfAYfM021px2v6jO/lsKGw3KZ2IJaUPFoedA3IMYNsRT6U60Zj9ZoAaSL+SQOSf2NxCN4WaYEqb8kEzIh2EwQ==
[email protected]6:
+  version "0.6.16"
+  resolved "https://registry.yarnpkg.com/mldoc/-/mldoc-0.6.16.tgz#6cad0c9ce0015c92a630d7dc4c4fb2835f34eb98"
+  integrity sha512-9f9hCPaxIjd5bFugR1pgcH6m5Fwjnme9eGVty/uUch+k81wdey+fCzbp8szazP2J3Eneu5Z/181Tre501mpwwQ==
   dependencies:
     yargs "^12.0.2"