           [text state]
           (re-seq subs-regex text)))
 
+;; NOTE Extends default heading transformer with clickable section headers.
 (defn- heading-transformer [text {:keys [code codeblock heading-anchors heading-links] :as state}]
   (cond (or code codeblock)
         [text state]

                         t))
                  t)
                "</h" h ">")
           (assoc state :heading true)])

        :else
        [text state]))

        (heading-level text)
        (let [h (heading-level text)
              t (heading-text text)
              ;; NOTE Not to expand potential formatting in the label.
              [l s] (freeze-string (sanitize t) state)]
          [(str "<h" h ">"
                (if heading-anchors
                  (str "<a name=\"" l "\"></a>"
