https://bugzilla.wikimedia.org/show_bug.cgi?id=53135

       Web browser: ---
            Bug ID: 53135
           Summary: Clean up single vs. multi-part data-mw
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: DOM
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

We currently use { target: {}, params: {} } for single-transclusion content,
and {parts: [{template:{target: {}, params: {}, i: 0}}]} for multi-part
transclusions and extensions. This creates special cases and makes it necessary
to know all keys to convert the single-transclusion format into the parts bit.

The missing namespacing also makes it harder than necessary to add additional
information to data-mw.

To clean this up, we should consider moving to always using an array format
like this:

parts: [{"@type":"mw:Transclusion", target: {}, params: {}}]

The change to always use an array is already supported by VisualEditor.
Flattening the nested object and using a JSON-LDish @type key makes the parts
structure more regular and easier to extend. It also moves it closer to the
RDFa names. Both us and VE can support both formats as an input for a while to
avoid caching issues, but should start by only emitting the new format.

See also:
http://json-ld.org/playground/index.html -- some example JSON-LD

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to