     (set-marker (layout/translations fmt))
     (case fmt
       ;; handle the special case where the editorial or the recommendations are passed in the tree
-      (:editorial :recommendations :recommendation) (md-to-fop items)
+      (:editorial :recommendations :recommendation) (md-to-fop items [fmt] path-to-numbers)
       (:hörfilm :ludo) (entries-sexp items)
       (mapcat #(genre-sexp (get items %) fmt % (inc level) path-to-numbers) (order (keys items))))]))
 

    (set-marker (layout/translations genre))
    (cond
      ;; handle the special case where the editorial or the recommendations are passed in the tree
      (#{:editorial :recommendations :recommendation} genre) (md-to-fop items)
      (#{:kinder-und-jugendbücher} genre) (subgenres-sexp items fmt genre (inc level) path-to-numbers)
      (#{:hörbuch} fmt) (subgenres-sexp items fmt genre (inc level) path-to-numbers)
      :else (entries-sexp items))]))

    {:start-indent "body-start()"}
    (block body)]])

(defmulti to-fop (fn [{:keys [tag attrs content]} _ _] tag))
(defmethod to-fop :p [{content :content} _ _] (block {:space-before "17pt"} content))
(defmethod to-fop :a [{content :content {href :href} :attrs} _ _]
  (if (not-empty content)
    (apply #(external-link href %) content)
    (external-link href href)))
(defmethod to-fop :h1 [{content :content} path path-to-numbers]
  (heading :h1 (conj path (string/join content)) path-to-numbers))
(defmethod to-fop :h2 [{content :content} path path-to-numbers]
  (heading :h2 (conj path (string/join content)) path-to-numbers))
(defmethod to-fop :h3 [{content :content} path path-to-numbers]
  (heading :h3 (conj path (string/join content)) path-to-numbers))
(defmethod to-fop :ul [{content :content} _ _] [:fo:list-block content])
(defmethod to-fop :li [{content :content} _ _] (bullet-list content))
(defmethod to-fop :em [{content :content} _ _] (inline {:font-style "italic"} content))
(defmethod to-fop :strong [{content :content} _ _] (inline {:font-weight "bold"} content))
(defmethod to-fop :br [_ _ _] [:fo:block ])
(defmethod to-fop :default [{content :content} _ _] (apply block content)) ; just assume :p

(defn- node? [node]
  (and (map? node) (or (set/subset? #{:tag :content} (set (keys node))) (= (:tag node) :br))))

(defn- visitor [node path path-to-numbers]
  (if (node? node)
    (to-fop node path path-to-numbers)
    node))

(defn md-to-fop [markdown path path-to-numbers]
  (->>
   markdown
   endophile/mp
   endophile/to-clj
   (walk/postwalk #(visitor % path path-to-numbers))))


(defn- branch? [node]
  (when-let [ks (and (map? node) (keys node))]
