         badge-template (pdf/template
                          [:paragraph.generic
                           (when-not (empty? $user_badges)
-                            [:spacer 0]
-                            [:heading.heading-name (t :badge/Mybadges ul)]
-                            (into [:paragraph]
+
+                            (into [:paragraph
+                                   [:spacer 0]
+                                   [:heading.heading-name (t :badge/Mybadges ul)]]
                                   (for [b $user_badges
                                         :let [more-badge-info (replace-nils (b/get-badge ctx (:id b) user-id))
                                               content (:content more-badge-info)

                                                                            [:chunk.chunk (str (t :badge/OBFurl ul) ": ")] [:anchor {:target (:obf_url b)} [:chunk.link (:obf_url b)]]"\n"
                                                                            [:chunk.chunk (str (t :badge/Assertionurl ul) ": ")] [:anchor {:target (:assertion_url more-badge-info) } [:chunk.link (str (:assertion_url more-badge-info))]]"\n"
                                                                            [:chunk.chunk (str (t :badge/Assertionjson ul) ": ")][:chunk (str (:assertion_json more-badge-info))]"\n"
                                                                            [:chunk.chunk (str (t :badge/Badgerating ul) ": ") ] [:chunk (str (:rating more-badge-info) "  ")]
                                                                            [:chunk.chunk (str (t :badge/Evidenceurl ul) ": ")] [:anchor {:target (:evidence_url more-badge-info)} [:chunk.link (str (:evidence_url more-badge-info) " ")]]"\n"
                                                                            (when (not-empty (:alignment %))
                                                                              [:paragraph
                                                                               [:chunk.chunk (str (t :badge/Alignments ul) ": " (count (:alignment %)))]"\n"

         user-following-fn (first (util/plugin-fun (util/get-plugins ctx) "db" "get-user-following-connections-user"))
         user-following (if-not (nil? user-followers-fn) (user-following-fn ctx user-id) ())]
     (replace-nils (assoc all-user-info
                     :emails email-addresses
                     :user_badges user-badges
                     :user_pages user-pages
                     :user_files user-files
                     :events events
                     :connections connections
                     :pending_badges pending-badges
                     :user_followers user-followers
                     :user_following user-following
                     )))))

(defn strip-html-tags [s]
