                             :static-brushes (:brush amap)
                             :verbose? (:verbose amap)}
                 *single-comment* (:comment amap)
-                *language* (or (:language amap) *language*)]
+                *language* (canonical-lang (or (:language amap) *language*))]
 
 ; When no output file is given, the program renders to standard-out.
         (if (= 1 (count tail))

; from the `path` suffix, and if that fails they are set to the values they
; have in the enclsing dynamic scope (i.e., from the commandline or the
; including file).
  (binding [*language* (or lang
                           (re-find #"(?<=\.)[^.]+$" path)
                           *language*)]
    (binding [*single-comment* (or token
                                   (first (languages *language*))
                                   *single-comment*)]
      (binding [*path* path]
        (wrap-in-tags tag
          (if (#{"markdown" "md"} *language*)

; A markdown file is a special case. It is treated as a single comment block.
            (html<- [:comment (slurp path)])

; SyntaxHighlighter brushes are associated with files if the language is
; supplied or can be worked out from the file suffix.
(defn maybe-associate-brush [path lang]
  (when-let [b (and lang (lang-brush lang))]
    (when-not (@*brushes* b)
      (message "Associating "path " with brush " b)
      (swap! *brushes* conj b))))
