diff --git a/src/main/frontend/util.cljc b/src/main/frontend/util.cljc index fd3724847..ff9ec008c 100644 --- a/src/main/frontend/util.cljc +++ b/src/main/frontend/util.cljc @@ -789,7 +789,10 @@ #?(:cljs (defn get-blocks-noncollapse [] (->> (d/by-class "ls-block") - (filter (fn [b] (not= "none" (d/style b "display"))))))) + (filter (fn [b] + (if-let [parent (gdom/getParentElement b)] + (not= "none" (d/style parent "display")) + false)))))) ;; Take the idea from https://stackoverflow.com/questions/4220478/get-all-dom-block-elements-for-selected-texts. ;; FIXME: Note that it might not works for IE.