From a9d73e3b2665ba29f2fa124aae0f100189f512b1 Mon Sep 17 00:00:00 2001 From: Javier Olaechea Date: Fri, 15 Aug 2014 20:18:40 -0500 Subject: [PATCH] Bind content-text & add quotes to HTML attributes --- plugins/twitter-summary-card.lisp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/twitter-summary-card.lisp b/plugins/twitter-summary-card.lisp index 8a13889..77aff6f 100644 --- a/plugins/twitter-summary-card.lisp +++ b/plugins/twitter-summary-card.lisp @@ -1,5 +1,5 @@ (defpackage :coleslaw-twitter-summary-card - (:use :cl) + (:use :cl :coleslaw) (:export #:enable)) (in-package :coleslaw-twitter-summary-card) @@ -7,12 +7,15 @@ (defun summary-card (post twitter-handle) "TODO: Figure if and how to include twitter:url meta property." (format nil " -~@[~] - -" +~@[~] + +" twitter-handle (title-of post) - (content-text post))) + (let ((text (content-text post))) + (if (< 200 (length text)) + (subseq text 0 199) + text)))) (defun enable (&key twitter-handle) (add-injection