|
@@ -471,10 +471,14 @@
|
|
|
((equal "photo" (aget "type" item))
|
|
((equal "photo" (aget "type" item))
|
|
|
(%vk-find-best-photo (aget "photo" item)))))
|
|
(%vk-find-best-photo (aget "photo" item)))))
|
|
|
|
|
|
|
|
|
|
+(defparameter +vk-link-scanner+ (cl-ppcre:create-scanner "\\[((id|club)\\d+)\\|([^\\]]*?)\\]") "vk linking regex")
|
|
|
|
|
+(defun %vk-format-text (text)
|
|
|
|
|
+ (cl-ppcre:regex-replace-all +vk-link-scanner+ text "[\\3](https://vk.com/\\1)"))
|
|
|
|
|
+
|
|
|
(defun %vk-post-text (post)
|
|
(defun %vk-post-text (post)
|
|
|
(alexandria:when-let (reposts (aget "copy_history" post))
|
|
(alexandria:when-let (reposts (aget "copy_history" post))
|
|
|
(setf post (car (last reposts))))
|
|
(setf post (car (last reposts))))
|
|
|
- (let ((text (aget "text" post))
|
|
|
|
|
|
|
+ (let ((text (%vk-format-text (aget "text" post)))
|
|
|
(attachs (format nil "~{~A~^~%~}"
|
|
(attachs (format nil "~{~A~^~%~}"
|
|
|
(remove nil (mapcar #'%format-attachment
|
|
(remove nil (mapcar #'%format-attachment
|
|
|
(aget "attachments" post))))))
|
|
(aget "attachments" post))))))
|