ruricolist / spinneret

Common Lisp HTML5 generator
MIT License
369 stars 26 forks source link

:p tag not getting closed #100

Open qubit55 opened 1 month ago

qubit55 commented 1 month ago

Hello, the following code:

(with-html-string
  (with-html
    (:p "Abc")
    (:a "Read more")))

produces the following html:

"<p>Abc
 <a>Read more</a>"

For some reason the :p tag is not getting closed.

Spinneret version 3.0

qubit55 commented 1 month ago

Sorry, just realized after reading through some html docs that the :p tag doesn't have to be closed. Somehow, the browser interprets the code I pasted above as this:

"<p>Abc
   <a>Read more</a>"
 </p>

instead of this:

"<p>Abc
 <a>Read more</a>"

So, I'm not sure what I'm missing.

qubit55 commented 1 month ago

Ah, never mind, since the :a tag is allowed in :p, of course the browser will interpret it that way :facepalm

Sorry, HTML noob here.

ruricolist commented 1 month ago

You can bind the *html-style* variable to control if closing tags are always printed.