Browse Source

feat: remove the manually title prop check in filename conversion

Junyi Du 3 years ago
parent
commit
ff72d0dcaa
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/main/frontend/handler/conversion.cljs

+ 7 - 7
src/main/frontend/handler/conversion.cljs

@@ -58,6 +58,8 @@
 ;;   - the special rule in `is-manual-title-prop?`
 ;;   - the special rule in `is-manual-title-prop?`
 (defonce supported-filename-formats [:triple-lowbar :legacy])
 (defonce supported-filename-formats [:triple-lowbar :legacy])
 
 
+;; In case of recovering this check in future
+#_:clj-kondo/ignore
 (defn- is-manual-title-prop?
 (defn- is-manual-title-prop?
   "If it's an user defined title property instead of the generated one"
   "If it's an user defined title property instead of the generated one"
   [format file-body prop-title]
   [format file-body prop-title]
@@ -74,14 +76,12 @@
   ;;   and it includes reserved characters, format config change / file renaming is required. 
   ;;   and it includes reserved characters, format config change / file renaming is required. 
   ;;   It's about user's own data management decision and should be handled
   ;;   It's about user's own data management decision and should be handled
   ;;   by user manually.
   ;;   by user manually.
-  ;; Don't rename page that with a custom setup `title` property
-  (when (not (is-manual-title-prop? old-format file-body prop-title))
-      ;; the 'expected' title of the user when updating from the previous format, or title will be broken in new format
-    (or (when (and (nil? prop-title)
-                   (not= old-format new-format))
-          (calc-previous-name old-format new-format file-body))
+  ;; the 'expected' title of the user when updating from the previous format, or title will be broken in new format
+  (or (when (and (nil? prop-title)
+                 (not= old-format new-format))
+        (calc-previous-name old-format new-format file-body))
       ;; if no break-change conversion triggered, check if file name is in an informal / outdated style.
       ;; if no break-change conversion triggered, check if file name is in an informal / outdated style.
-        (calc-current-name new-format file-body prop-title))))
+      (calc-current-name new-format file-body prop-title)))
 
 
 (defn calc-rename-target
 (defn calc-rename-target
   "Return the renaming status and new file body to recover the original title of the file in previous version. 
   "Return the renaming status and new file body to recover the original title of the file in previous version.