Improve render function

This commit is contained in:
Akira Tempaku 2024-05-30 09:22:18 +09:00
commit 6a6e3231e7
2 changed files with 21 additions and 15 deletions

View file

@ -63,9 +63,10 @@
(let ((type-str (string-downcase type)))
(if children
(format stream
(if (rest children)
"~@<<~a~a>~2I~:@_~<~@{~a~^~:@_~}~:>~0I~:@_</~a>~:>"
"~@<<~a~a>~2I~:_~<~a~^~:@_~:>~0I~_</~a>~:>")
(if (and (null (rest children))
(typep (first children) 'string))
"~@<<~a~a>~2I~:_~<~a~^~:@_~:>~0I~_</~a>~:>"
"~@<<~a~a>~2I~:@_~<~@{~a~^~:@_~}~:>~0I~:@_</~a>~:>")
type-str
(props->string props)
children