ruricolist / spinneret

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

Attributes are not wrapped with "" #78

Closed diasbruno closed 1 year ago

diasbruno commented 1 year ago

Is there an option for this?

Using

:attrs (list :alt text :src link)

produces

alt=normal text like this src=link
ruricolist commented 1 year ago

I can't seem to reproduce this. Can you give more context?

For reference, what I see is:

(with-html (:img :attrs (list :alt text :src link)))
=> <img alt="my text" src=link>
diasbruno commented 1 year ago

:thinking: Is there some kind of list that controls which attributes to add the ""? I'm looking for a way to wrap all attributes with "".

(with-html (:img :attrs (list :alt text :src link)))
=> <img alt="my text" src="https://mimimi...">
diasbruno commented 1 year ago

It seems that need-quotes? controls this.

https://github.com/ruricolist/spinneret/blob/master/syntax.lisp#L31

ruricolist commented 1 year ago

So to be clear, you want a configuration option that forces all attributes to be quoted? That would be easy to add.

diasbruno commented 1 year ago

Yep. *always-quote* would be ok? I think I can make a PR for it.

ruricolist commented 1 year ago

Sure, go ahead.

On Sun, Apr 23, 2023, 10:41 AM Bruno Dias @.***> wrote:

Yep. always-quote would be ok? I think I can make a PR for it.

— Reply to this email directly, view it on GitHub https://github.com/ruricolist/spinneret/issues/78#issuecomment-1519095668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC7AKA6ACWV2MLPBV452LLXCVESDANCNFSM6AAAAAAXIRMKP4 . You are receiving this because you commented.Message ID: @.***>