Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kisp opened this issue Mar 22, 2018 · 1 comment

Comments

@kisp
Copy link

kisp commented Mar 22, 2018

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*).

@kisp
Copy link
Author

kisp commented Mar 22, 2018

That fixes it for me https://github.com/kisp/cl-markup/commit/703a6a4087ee4de948b83f61874024de29e2a004

Should I open a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant