diff --git a/lib/chibi/doc-test.sld b/lib/chibi/doc-test.sld index e5663bda..1313d900 100644 --- a/lib/chibi/doc-test.sld +++ b/lib/chibi/doc-test.sld @@ -36,4 +36,14 @@ " line")) (ansi->sxml "plain \x1B;[4munder \x1B;[31mred\x1B;[39m line\x1B;[24m")) + (test '(code "(" "string?" " " + (span (@ (class . "string")) "\"hello\"") + ")") + (expand-docs '(scheme "(string? \"hello\")") + (make-default-doc-env))) + (test '(code "(" "string?" " " + (span (@ (class . "string")) "\"\"") + ")") + (expand-docs '(scheme "(string? \"\")") + (make-default-doc-env))) (test-end)))) diff --git a/lib/chibi/doc.scm b/lib/chibi/doc.scm index ed7c0a21..c0847045 100644 --- a/lib/chibi/doc.scm +++ b/lib/chibi/doc.scm @@ -267,6 +267,8 @@ (url . ,expand-url) (hyperlink . ,expand-hyperlink) (rawcode . code) + (pre . pre) + (bibitem . ,(lambda (x env) '())) ;; TODO: bibtex (code . ,expand-code) (codeblock . ,expand-codeblock) (ccode diff --git a/lib/chibi/highlight.scm b/lib/chibi/highlight.scm index fe4785c2..862fb1c3 100644 --- a/lib/chibi/highlight.scm +++ b/lib/chibi/highlight.scm @@ -121,10 +121,6 @@ (cond ((eof-object? c) (reverse-list->string ls)) ((eqv? c term) (reverse-list->string (cons c ls))) - ((eqv? c #\<) (read-escaped in term `(#\; #\t #\l #\& ,@ls))) - ;;((eqv? c #\>) (read-escaped in term `(#\; #\t #\g #\& ,@ls))) - ((eqv? c #\&) (read-escaped in term `(#\; #\p #\m #\a #\& ,@ls))) - ((eqv? c #\\) (read-escaped in term (cons (read-char in) (cons c ls)))) (else (read-escaped in term (cons c ls)))))) (define (read-to-eol in ls) @@ -134,9 +130,6 @@ ((eqv? c #\newline) (reverse-list->string (cons c ls))) (else (read-to-eol in (cons c ls)))))) -(define (html-escape str) - (call-with-input-string str (lambda (in) (read-escaped in #f '())))) - (define (collect str res) (if (pair? str) (cons (reverse-list->string str) res) res))