From ae57a0d043fe3030b0c673e85de2641a2b235bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 8 Jun 2017 23:44:04 +0200 Subject: [PATCH] Correctly render spoilers with TeX --- spoiler1.rkt | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/spoiler1.rkt b/spoiler1.rkt index bcd1d7fa..fea42a6b 100644 --- a/spoiler1.rkt +++ b/spoiler1.rkt @@ -13,7 +13,8 @@ scribble/decode scribble/html-properties hyper-literate - (for-syntax syntax/parse)) + (for-syntax syntax/parse) + scriblib/render-cond) (define spoiler-css #" @@ -115,18 +116,27 @@ EOJS (chunk #:save-as ck1 #:display-only #:button - (list " " (smaller (spoiler-button-default-to-alt "expand"))) + (cond-element + [html (list " " (smaller + (spoiler-button-default-to-alt "expand")))] + [else (list)]) name default ...) (chunk #:save-as ck2 #:button - (list " " (smaller (spoiler-button-alt-to-default "collapse"))) + (cond-element + [html (list " " (smaller + (spoiler-button-alt-to-default "collapse")))] + [else (list)]) name expanded ...) - (nested-flow spoiler-wrapper-collapsed - (list (nested-flow spoiler-default - (decode-flow (ck1))) - (nested-flow spoiler-alt - (decode-flow (ck2))))))])) \ No newline at end of file + (cond-block + [html (nested-flow spoiler-wrapper-collapsed + (list (nested-flow spoiler-default + (decode-flow (ck1))) + (nested-flow spoiler-alt + (decode-flow (ck2)))))] + [else (nested-flow (style #f '()) + (decode-flow (ck2)))]))])) \ No newline at end of file