diff --git a/tekuti/filters.scm b/tekuti/filters.scm index bccf992..6ff1885 100644 --- a/tekuti/filters.scm +++ b/tekuti/filters.scm @@ -81,15 +81,24 @@ (define (wordpress->sxml text) (let ((sxml (cadr (with-input-from-string* (string-append "
" text "
") - xml->sxml)))) + (lambda () (xml->sxml #:namespaces '((svg . "http://www.w3.org/2000/svg")))))))) (pre-post-order sxml `((*default* . ,(lambda (tag . body) - (if (can-contain-p? tag) - (wpautop tag body) - (cons tag body)))) + (let ((tag (if (string-prefix? "svg:" (symbol->string tag)) + (string->symbol (substring (symbol->string tag) 4)) + tag))) + (if (can-contain-p? tag) + (wpautop tag body) + (cons tag body))))) (*text* . ,(lambda (tag text) - text)))))) + text)) + (svg:svg . ,(lambda (tag . body) + (cons 'svg + (cons `(@ (xmlns "http://www.w3.org/2000/svg") + (xmlns:xlink "http://www.w3.org/1999/xlink") + ,@(cdar body)) + (cdr body))))))))) (define (marxdown->sxml text) (smarxdown->shtml (call-with-input-string text marxdown->smarxdown))) diff --git a/tekuti/page.scm b/tekuti/page.scm index 3fcd26b..917f316 100644 --- a/tekuti/page.scm +++ b/tekuti/page.scm @@ -301,10 +301,13 @@ (post-from-key index key)) (hash-ref tags tag '())))) (if (pair? posts) - (respond `(,(tag-sidebar tag index) - (h2 "posts tagged \"" ,tag "\"") - ,@(map (lambda (post) (show-post post #f)) - (take-max (reverse posts) 10))) + (respond `((h2 "posts tagged \"" ,tag "\" (" + ,(rellink '("feed" "atom") "feed" + #:query `(("with" . ,tag))) + ")") + ,@(map (lambda (post) `(p ,(post-link post))) + (take-max (reverse posts) 10)) + ,(related-tag-cloud tag index)) #:etag (assq-ref index 'master) #:title (string-append "posts tagged \"" tag "\"")) (respond `((h2 "Unknown tag " ,tag)