Skip to content

Support keywords in :class vectors#38

Open
escherize wants to merge 4 commits intomasterfrom
support-keyword-class-values
Open

Support keywords in :class vectors#38
escherize wants to merge 4 commits intomasterfrom
support-keyword-class-values

Conversation

@escherize
Copy link
Owner

@escherize escherize commented Feb 28, 2026

Summary

Test plan

  • All existing tests pass (updated emit-attrs call sites and removed var-quotes)
  • New: keyword class vector produces correct output and matches string equivalent
  • New: backslash renders as \ not '
  • New: attr-mapper transforms attribute values across nested elements

Add (map stringify) before (remove str/blank?) in the class-merging
logic of tag-node emit. Previously, keyword class values like
[:flex :flex-auto] caused a ClassCastException because str/blank?
expects CharSequence. Now keywords are stringified first, matching
Reagent's behavior.
The backslash entry mapped \\ to ' (single quote entity), which
is wrong in two ways: it produced the wrong character, and backslashes
don't need HTML escaping per the HTML5 spec. Matches hiccup behavior.

Closes #31
Thread an :attr-mapper function through opts to emit-attrs. When
provided, each [key value] attribute pair is mapped through the
function before emission, allowing arbitrary attribute transformations
(e.g. keyword-to-string lookups, value normalization).

Closes #30
…blic

These helpers are useful for extending the emit multimethod with
custom node types. Changed defn- to defn and removed var-quotes
from tests.

Closes #29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant