From 09499acd48b979dd05ebb45d5ac024b14d30d8f1 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 28 Aug 2023 18:07:58 +0100 Subject: html: Implement flush without HTML tables. * src/guile/skribilo/engine/html.scm (flush): Implement without HTML tables, using CSS only. --- src/guile/skribilo/engine/html.scm | 48 ++++++++++++-------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm index 2c70ef8..01fb583 100644 --- a/src/guile/skribilo/engine/html.scm +++ b/src/guile/skribilo/engine/html.scm @@ -1683,39 +1683,21 @@ ignored, return #f." ;* flush ... */ ;*---------------------------------------------------------------------*/ (markup-writer 'flush - :options '(:side) - :before (lambda (node engine) - (case (markup-option node :side) - ((center) - (html-open 'center - `((class . ,(markup-class node))))) - ((left) - (html-open 'p - `((class . ,(markup-class node)) - (style . "text-align:left;")))) - ((right) - (html-open 'table - `((width . "100%") - (cellpadding . "0") - (cellspacing . "0") - (border . "0"))) - (html-open 'tr) - (html-open 'td - '((align . "right")))) - (else - (skribe-error 'flush - "Invalid side" - (markup-option node :side))))) - :after (lambda (node engine) - (case (markup-option node :side) - ((center) - (html-close 'center)) - ((right) - (html-close 'td) - (html-close 'tr) - (html-close 'table)) - ((left) - (html-close 'p))))) + :options '(:side) + :before (lambda (node engine) + (let ((text-align + (case (markup-option node :side) + ((left center right) + (symbol->string (markup-option node :side))) + (else + (skribe-error 'flush + "Invalid side" + (markup-option node :side)))))) + (html-open 'span + `((class . ,(markup-class node)) + (style . ,(style-declaration + `((text-align . ,text-align)))))))) + :after "\n") ;*---------------------------------------------------------------------*/ ;* center ... */ -- cgit v1.2.3