Compare commits
No commits in common. "f880847f157971e2344d6db53fe1214fb1e050c4" and "cc4ce6cad40640a80be599764232df2a374899f1" have entirely different histories.
f880847f15
...
cc4ce6cad4
2 changed files with 9 additions and 21 deletions
|
@ -81,24 +81,15 @@
|
|||
|
||||
(define (wordpress->sxml text)
|
||||
(let ((sxml (cadr (with-input-from-string* (string-append "<div>" text "</div>")
|
||||
(lambda () (xml->sxml #:namespaces '((svg . "http://www.w3.org/2000/svg"))))))))
|
||||
xml->sxml))))
|
||||
(pre-post-order
|
||||
sxml
|
||||
`((*default* . ,(lambda (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)))))
|
||||
(if (can-contain-p? tag)
|
||||
(wpautop tag body)
|
||||
(cons tag body))))
|
||||
(*text* . ,(lambda (tag 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)))))))))
|
||||
text))))))
|
||||
|
||||
(define (marxdown->sxml text)
|
||||
(smarxdown->shtml (call-with-input-string text marxdown->smarxdown)))
|
||||
|
|
|
@ -301,13 +301,10 @@
|
|||
(post-from-key index key))
|
||||
(hash-ref tags tag '()))))
|
||||
(if (pair? posts)
|
||||
(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))
|
||||
(respond `(,(tag-sidebar tag index)
|
||||
(h2 "posts tagged \"" ,tag "\"")
|
||||
,@(map (lambda (post) (show-post post #f))
|
||||
(take-max (reverse posts) 10)))
|
||||
#:etag (assq-ref index 'master)
|
||||
#:title (string-append "posts tagged \"" tag "\""))
|
||||
(respond `((h2 "Unknown tag " ,tag)
|
||||
|
|
Loading…
Reference in a new issue