Browse Source

chore: disable auto headings on markdown mode

Konstantinos Kaloutas 3 years ago
parent
commit
1aebde26e8
2 changed files with 5 additions and 1 deletions
  1. 4 1
      src/main/frontend/components/content.cljs
  2. 1 0
      src/main/frontend/dicts.cljc

+ 4 - 1
src/main/frontend/components/content.cljs

@@ -188,7 +188,10 @@
             :icon "h-auto"
             :icon-props {:extension? true}
             :class "to-heading-button"
-            :title (t :auto-heading)
+            :title (if (= format :markdown) 
+                     (str (t :auto-heading) " - " (t :not-available-in-mode format)) 
+                     (t :auto-heading))
+            :disabled (= format :markdown)
             :on-click (fn [_e]
                         (editor-handler/set-heading! block-id format true))
             :intent "link"

+ 1 - 0
src/main/frontend/dicts.cljc

@@ -340,6 +340,7 @@
         :remove-heading "Remove heading"
         :heading "Heading {1}"
         :auto-heading "Auto heading"
+        :not-available-in-mode "Not available in {1} mode"
         :open "Open"
         :open-a-directory "Open a local directory"
         :user/delete-account "Delete account"