Skip to content

Unify custom + extension elements into one arbitrary-element tree #276

Description

@mmcdole

Right now unknown elements are handled three inconsistent ways: namespaced elements become the recursive ext.Extension tree, non-namespaced ones on items go into Item.Custom map[string]string (flat, drops nesting and attributes, see #203), and unknown elements at feed root are Skipped and lost.

Consolidate to a single arbitrary-element tree: everything that isn't a known element (namespaced or not, at any level) parses into one ext.Extension-style structure that preserves nesting, attributes, and repetition, with ergonomic accessors (GetValue("a","b") etc.).

This can land in v1 additively: build the tree into a new field and keep Item.Custom as a shim populated from it (leaf text for simple elements, so existing reads are unchanged; nested elements stop corrupting). Removing Item.Custom outright is the only breaking part, and that can wait for a future v2.

Most of this already exists on the v2-custom-elements branch. This tracks finishing and landing it, plus fixing parseExtensionElement while we're in there (the O(n^2) value concat and the raw loop from #9).

Related: #82, #203, #205.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions