Skip to content

Rendering to *output-stream* gives different result than rendering to string #13

Open
@kisp

Description

@kisp

Hi,

while playing around with rendering to *output-stream* versus rendering to a string, I got the following:

CL-USER> (use-package :cl-markup)
T
CL-USER> (markup (:ul (loop for item in '(1 2 3) collect (markup (:li item)))))
"<ul><li>1</li><li>2</li><li>3</li></ul>"
CL-USER> (let ((*output-stream* t))
           (markup (:ul (loop for item in '(1 2 3) collect (markup (:li item))))))
<ul><li>1</li><li>2</li><li>3</li></li></li></li></ul>
"</ul>"
CL-USER> 

Note the additional and unexpected closing tags </li> in the second output.

Is this invalid client code or a bug?

If it is a bug, perhaps the expansion under the (IF *OUTPUT-STREAM* regime should generate a PROGN that contains NIL as its last form.

In the above example, the last form of the PROGN is (WRITE-STRING "</li>" *OUTPUT-STREAM*).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions