ruricolist/spinneret

Treat colon-prefixed `deftag`ged tags as custom (allow `:tag.class` and `:tag#id` syntax)

aartaka opened this issue · 4 comments

I'm defining a lot of colon-prefixed/keyword tags, because this way all the Spinneret-dependent code looks more consistent. However, these new keyword tags don't support the inline class/id syntax—if one add a .class or #id to them, an "undefined function" error is raised.

Example:

(in-package :spinneret)
(deftag :selfref (body attrs &key href &allow-other-keys)
  `(:a.selfref :href ,href ,@attrs ,@body))

(with-html-string
  (:selfref#id :href "https://example.com" "Example website"))
;;; => UNDEFINED-FUNCTION: The function :|SELFREF#ID| is undefined.

The expected behavior is that user-defined keyword tags are treated equal to the built-in ones, at least in these syntactic regards.

EDIT: typo fix

@ruricolist, any input? I'm pretty sure it's an easy fix, but I haven't found the exact place the error comes from...

It's on my list but I haven't had time to look at it yet.

I do think it is something I would like to support.

No hurry, thanks for your work ❤️