From 588d63d901984bdff9f62525a3cbbd3af9e7af92 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Thu, 26 Dec 2019 22:49:18 +0800 Subject: [PATCH] don't escape html in sxml-display-as-text, add newline after li (issue #592) --- lib/chibi/app.scm | 14 +++++++------- lib/chibi/sxml.scm | 4 ++-- tools/chibi-doc | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/chibi/app.scm b/lib/chibi/app.scm index 19d94bf7..178e31df 100644 --- a/lib/chibi/app.scm +++ b/lib/chibi/app.scm @@ -15,12 +15,12 @@ ;;> where clauses can be any of: ;;> ;;> \itemlist[ -;;> \item[\scheme{(@ )} - option spec, described below] -;;> \item[\scheme{(begin: )} - procedure to run before main] -;;> \item[\scheme{(end: )} - procedure to run after main] -;;> \item[\scheme{( args ...)} - main procedure (args only for documentation)] -;;> \item[\scheme{} - a subcommand described by the nested spec] -;;> \item[\scheme{(or ...)} - an alternate list of subcommands] +;;> \item{\scheme{(@ )} - option spec, described below} +;;> \item{\scheme{(begin: )} - procedure to run before main} +;;> \item{\scheme{(end: )} - procedure to run after main} +;;> \item{\scheme{( args ...)} - main procedure (args only for documentation)} +;;> \item{\scheme{} - a subcommand described by the nested spec} +;;> \item{\scheme{(or ...)} - an alternate list of subcommands} ;;> ] ;;> ;;> For subcommands the symbolic command name must match, though it is @@ -40,7 +40,7 @@ ;;> ;;> \itemlist[ ;;> \item{\scheme{boolean} - boolean, associated value optional, allowing \scheme{--noname} to indicate \scheme{#false}} -;;> \item{[\scheme{char} - a single character} +;;> \item{\scheme{char} - a single character} ;;> \item{\scheme{integer} - an exact integer} ;;> \item{\scheme{real} - any real number} ;;> \item{\scheme{number} - any real or complex number} diff --git a/lib/chibi/sxml.scm b/lib/chibi/sxml.scm index af3af40d..991c61cb 100644 --- a/lib/chibi/sxml.scm +++ b/lib/chibi/sxml.scm @@ -146,9 +146,9 @@ (if (and (pair? (cdr sxml)) (eq? '@ (cadr sxml))) (cddr sxml) (cdr sxml))) - (if (memq tag '(p br h1 h2 h3 h4 h5 h6)) + (if (memq tag '(p li br h1 h2 h3 h4 h5 h6)) (newline out))) (else (for-each lp sxml))))) ((null? sxml)) - (else (html-display-escaped-string sxml out)))))) + (else (display sxml out)))))) diff --git a/tools/chibi-doc b/tools/chibi-doc index 28274a9b..b50d5791 100755 --- a/tools/chibi-doc +++ b/tools/chibi-doc @@ -55,7 +55,7 @@ ;; parse the command-line (let lp ((args (cdr (command-line))) - (render #f)) + (render sxml-display-as-text)) (cond ((and (pair? args) (not (equal? "" (car args))) (eqv? #\- (string-ref (car args) 0))) @@ -66,4 +66,5 @@ ((-) (run (cdr args) render)) (else (die "unknown option: " (car args))))) (else - (run args render)))) + (run args render))) + (newline))