                                                                     (into [:paragraph {:indent 0} ]
                                                                           (for [e issuer-endorsement]
                                                                             [:paragraph {:indent 0}
-                                                                             (or (:issuer_name e) "-") "\n"
-                                                                             [:anchor {:target (:issuer_url e) :style{:family :times-roman :color [66 100 162]}} (or (:issuer_url e) "-")] "\n"
-                                                                             [:chunk.link (date-from-unix-time (long (* 1000 (:issued_on e))))] "\n"
-                                                                             (when-not (blank? (:content e))
-                                                                               (markdown->clj-pdf {:wrap {:global-wrapper :paragraph}} (:content e)))]))]))
+                                                                             (:issuer_name e) "\n"
+                                                                             [:anchor {:target (:issuer_url e) :style{:family :times-roman :color [66 100 162]}} (:issuer_url e)] "\n"
+                                                                             [:chunk.link (if (number? (:issued_on e)) (date-from-unix-time (long (* 1000 (:issued_on e)))) (:issued_on e))] "\n"
+                                                                             (process-markdown "Issuer endorsements" (:content e))]))]))
 
                                                                [:pdf-table {:align :right :width-percent 100 :cell-border false}
                                                                 nil
                                                                 [[:pdf-cell [:paragraph {:align :right} [:chunk [:image  {:width 85 :height 85 :base64 true} $qr_code]]"\n"
-                                                                             [:phrase [:chunk.link {:style :italic} (str site-url "/badge/info/" $id)]]]]
-                                                                 ]]
-
+                                                                             [:phrase [:chunk.link {:style :italic} (str site-url "/badge/info/" $id)]]]]]]
                                                                [:pagebreak]])
 
                                content (if (= lang "all") (map template $content) (map template (filter #(= (:default_language_code %) (:language_code %)) $content)))]
 
-                           (reduce into [[:chapter ]] content)))]
+                           (reduce into [] content)))]
     (fn [output-stream]
       (pdf/pdf (into [pdf-settings] (badge-template badges)) output-stream)))
   )

  (let [data-dir (get-in ctx [:config :core :data-dir])
        site-url (get-in ctx [:config :core :site-url])
        badges (pdf-generator-helper ctx user-id input)
        ul (:language (ud/user-information ctx user-id))
        font-path  (first (mapcat #(get-in ctx [:config % :font] []) (get-plugins ctx)))
        font  {:ttf-name (str site-url font-path)}
        stylesheet {:heading-name {:color [127 113 121]


        pdf-settings  (if (empty? font-path) {:stylesheet stylesheet  :bottom-margin 0 :footer {:page-numbers false :align :right}} {:font font :stylesheet stylesheet  :bottom-margin 0 :footer {:page-numbers false :align :right}})
        badge-template (pdf/template
                         (let [template #(cons [:paragraph]  [ (if (and (not (= "-" (:image_file %)))(ends-with? (:image_file %) "png"))
                                                                 [:image {:width 100 :height 100 :align :center} (str data-dir "/" (:image_file %))]
                                                                 [:image {:width 100 :height 100 :align :center :base64 true} $qr_code ])

                                                               [:heading.heading-name (:name %)]
                                                               [:paragraph {:indent 20 :align :center} [:spacer]]
                                                               [:paragraph.generic {:align :left :style :italic} (:description %)][:spacer]
                                                               [:paragraph.generic
                                                                [:chunk.chunk (str (t :badge/Recipient ul)": ")] (str $first_name  " " $last_name ) "\n"
                                                                [:chunk.chunk (str (t :badge/Issuedby ul)": ")] (:issuer_content_name %)"\n"
                                                                (when-not (= "-" (:creator_name %))
                                                                  [:paragraph.generic
                                                                   [:chunk.chunk (str (t :badge/Createdby ul)": ")] (:creator_name %)])

                                                                [:chunk.chunk (str (t :badge/Issuedon ul)": ")] (if (number? $issued_on) (date-from-unix-time (long (* 1000 $issued_on)) "date") $issued_on) "\n"

                                                                [:paragraph
                                                                 [:chunk.chunk (str (t :badge/Expireson ul)": ")] (if (number? $expires_on) (date-from-unix-time (long (* 1000 $expires_on)) "date") $expires_on)]

                                                                (when-not (empty? $tags)
                                                                  [:paragraph.generic
                                                                   [:chunk.chunk (str (t :badge/Tags ul)": ")] (into [:phrase ] (for [t $tags] (str t " ")))])
                                                                [:paragraph
                                                                 (let [alignments (replace-nils (select-alignment-content {:badge_content_id (:badge_content_id %)} (u/get-db ctx)))]
                                                                   (when-not (empty? alignments)
                                                                     [:paragraph.generic
                                                                      [:spacer 0]
                                                                      [:phrase {:size 12 :style :bold} (str (t :badge/Alignments ul)": " (count alignments))]"\n"
                                                                      (into [:paragraph ] (for [a alignments]
                                                                                            [:paragraph
                                                                                             (:name a)"\n"
                                                                                             [:chunk {:style :italic} (:description a)] "\n"
                                                                                             [:chunk.link (:url a)] [:spacer 0]]) )]))]
                                                                [:paragraph
                                                                 [:chunk.chunk (str (t :badge/Criteria ul)": ")] [:anchor {:target (:criteria_url %) :style{:family :times-roman :color [66 100 162]}} (:criteria_url %)]]
                                                                [:spacer 0]
                                                                (process-markdown "Criteria" (:criteria_content %))]

                                                               (when-not (empty? $endorsements)
                                                                 [:paragraph.generic
