فهرست منبع

cl-mardown support

Innocenty Enikeew 11 سال پیش
والد
کامیت
8714914b6b
3فایلهای تغییر یافته به همراه8 افزوده شده و 7 حذف شده
  1. 2 1
      assboard.asd
  2. 5 5
      engine.lisp
  3. 1 1
      web.lisp

+ 2 - 1
assboard.asd

@@ -20,7 +20,8 @@
                :cl-who
                :restas
                :cl-date-time-parser
-               :log4cl)
+               :log4cl
+               :cl-markdown)
   :components ((:file "utils")
                (:file "gpg" :depends-on ("utils"))
                (:file "asswot" :depends-on ("utils"))

+ 5 - 5
engine.lisp

@@ -34,16 +34,16 @@
          (title (subseq cmd 10 title-end))
          (body (subseq cmd (+ title-end 2)))
          (posting
-          (pomo:make-dao 'assboard.data::posting
+          (pomo:make-dao 'data::posting
                          :author author
                          :title title
                          :body body))
          (posting-edition
-          (pomo:make-dao 'assboard.data::posting-edition
-                         :posting-id (assboard.data::posting-id posting)
+          (pomo:make-dao 'data::posting-edition
+                         :posting-id (data::posting-id posting)
                          :title title
                          :body body
-                         :raw-id (assboard.data::raw-id raw))))
+                         :raw-id (data::raw-id raw))))
     (values posting posting-edition)))
 
 (defun cmd/close-post (cmd raw))
@@ -84,7 +84,7 @@
                        *command-valid-for*)
               (error 'not-valid-timestamp-error))
             ;; All checks performed, store raw command text and process it
-            (let ((raw (pomo:make-dao 'assboard.data::raw
+            (let ((raw (pomo:make-dao 'data::raw
                                       :clearsigned clearsigned
                                       :fingerprint fgp
                                       :timestamp timestamp)))

+ 1 - 1
web.lisp

@@ -79,7 +79,7 @@
     :content
     (who:with-html-output-to-string (out)
       (:h1 (who:str (data::posting-title object)))
-      (:p (who:str (data::posting-body object)))))))
+      (:div (cl-markdown:markdown (data::posting-body object) :stream out))))))
 
 (restas:define-route posting ("posting/:id/")
   (let ((post (pomo:get-dao 'data::posting id)))