Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[:div {:class [:flex :flex-auto]}]now works, matching Reagent's behavior. Added(map stringify)before(remove str/blank?)in class-merging logic. Closes Support sequence of keywords in:class#32\\→'fromchar->replacement. The mapping was wrong (produced single quote instead of backslash) and backslashes don't need HTML escaping per the HTML5 spec. Closes Backslashes are rendered as single quotes instead #31:attr-mapperoption — New opt forhtml/pagethat maps over[key value]attribute pairs before emission, enabling custom attribute transformations. Closes Add ability to customize how attributes are emitted. #30emit-attrs,emit-style,tag->tag+id+classes, andempty-or-divpublic so they can be used when extendingemitwith custom node types. Closes Some private defns make extendingemitharder than necessary #29Test plan
emit-attrscall sites and removed var-quotes)\not'attr-mappertransforms attribute values across nested elements