Update variable name per Alex's suggestion.

This commit is contained in:
Arthur A. Gleckler 2022-10-11 07:17:31 -07:00
parent 4e24ad01e0
commit 24339e51e7

View file

@ -97,7 +97,7 @@
(let lp ((sxml (if (and (pair? sxml) (eq? '*TOP* (car sxml))) (let lp ((sxml (if (and (pair? sxml) (eq? '*TOP* (car sxml)))
(cdr sxml) (cdr sxml)
sxml)) sxml))
(i 0)) (depth 0))
(cond (cond
((pair? sxml) ((pair? sxml)
(let ((tag (car sxml)) (let ((tag (car sxml))
@ -119,21 +119,21 @@
(eq? '@ (caar rest))) (eq? '@ (caar rest)))
(when (and indent? (memq tag indentable-elements)) (when (and indent? (memq tag indentable-elements))
(newline out) (newline out)
(indent i out)) (indent depth out))
(display (html-tag->string tag (cdar rest)) out) (display (html-tag->string tag (cdar rest)) out)
(for-each (lambda (x) (lp x (+ 1 i))) (cdr rest)) (for-each (lambda (x) (lp x (+ 1 depth))) (cdr rest))
(unless (and (null? (cdr rest)) (memq tag void-elements)) (unless (and (null? (cdr rest)) (memq tag void-elements))
(display "</" out) (display tag out) (display ">" out))) (display "</" out) (display tag out) (display ">" out)))
(else (else
(when (and indent? (memq tag indentable-elements)) (when (and indent? (memq tag indentable-elements))
(newline out) (newline out)
(indent i out)) (indent depth out))
(display (html-tag->string tag '()) out) (display (html-tag->string tag '()) out)
(for-each (lambda (x) (lp x (+ 1 i))) rest) (for-each (lambda (x) (lp x (+ 1 depth))) rest)
(unless (and (null? rest) (memq tag void-elements)) (unless (and (null? rest) (memq tag void-elements))
(display "</" out) (display tag out) (display ">" out))))) (display "</" out) (display tag out) (display ">" out)))))
(else (else
(for-each (lambda (x) (lp x (+ 1 i))) sxml))))) (for-each (lambda (x) (lp x (+ 1 depth))) sxml)))))
((null? sxml)) ((null? sxml))
(else (html-display-escaped-string sxml out)))))) (else (html-display-escaped-string sxml out))))))