         function->html (comp function->html fn-metas)
         subcat->html (fn [subcat]
                        (cons [:h3.subcategory
-                              {:id (subcat-id subcat)}
-                              (:name subcat)]
+                              {:id (as-id (subcat-id subcat))}
+                              (u/escape-html (:name subcat))]
                              (map function->html (:fns subcat))))
         subcat->toc (fn [subcat]
                       (cons [:h4.subcategory (link (:name subcat) nil (subcat-id subcat))]

                                                 [:code processing-name])
                                               "None. It is present only in Quil.")
                "Added in" added)]
    [:div.function {:id name}
     [:h3 name]
     [:dl (for [[key val] fields]
            (list [:dt key] [:dd val]))]]))

  ([text to anchor]
     (let [page (if to (as-filename-ext to) "")]
      (e/link-to (if anchor
                   (str page "#" (as-url (as-id anchor)))
                   page)
                 (u/escape-html text)))))

(defn trim-docstring
  "Removes extra spaces in the begginning of dostringing lines."
