- Create a document that uses a template.
- Edit that document, and in VE add another instance of that template.
- Compare the VE data model for the pre-existing template and the just-added template.
This example is using {{sfn}} on enwiki:
| pre-existing | just-added |
You can see that the pre-existing one has a lot of extra information inside attributes.mw.
ve.dm.MWTransclusionModel sets this up in insertTransclusionNode, and has access to the generated contents that have just been fetched from the API, which is this case would be:
<p id="mwAg"><sup about="#mwt1" class="mw-ref reference" id="cite_ref-FOOTNOTESmith12_1-0" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"","name":"FOOTNOTESmith12"},"body":{"id":"mw-reference-text-cite_note-FOOTNOTESmith12-1"},"parts":[{"template":{"target":{"wt":"Sfn","href":"./Template:Sfn"},"params":{"1":{"wt":"Smith"},"2":{"wt":"12"}},"i":0}}]}'><a href="./Battle_of_the_Saw#cite_note-FOOTNOTESmith12-1" id="mwAw"><span class="mw-reflink-text" id="mwBA"><span class="cite-bracket" id="mwBQ">[</span>1<span class="cite-bracket" id="mwBg">]</span></span></a></sup></p> <div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" id="mwBw" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references" id="mwCA"><li about="#cite_note-FOOTNOTESmith12-1" id="cite_note-FOOTNOTESmith12-1" data-mw-footnote-number="1"><span class="mw-cite-backlink" id="mwCQ"><a href="./Battle_of_the_Saw#cite_ref-FOOTNOTESmith12_1-0" rel="mw:referencedBy" id="mwCg"><span class="mw-linkback-text" id="mwCw">↑</span></a></span> <span id="mw-reference-text-cite_note-FOOTNOTESmith12-1" class="mw-reference-text reference-text"><a rel="mw:WikiLink" href="./Battle_of_the_Saw#CITEREFSmith12" class="mw-selflink-fragment" id="mwDA">Smith <span typeof="mw:Entity" id="mwDQ">&</span> 12</a>.<span class="error harv-error" style="display: none; font-size:100%" id="mwDg"> sfn error: no target: CITEREFSmith12 (<a rel="mw:WikiLink" href="./Category:Harv_and_Sfn_template_errors" title="Category:Harv and Sfn template errors" id="mwDw">help</a>)</span><link rel="mw:PageProp/Category" href="./Category:Harv_and_Sfn_no-target_errors" id="mwEA"/></span></li> </ol></div>
i.e. all the information that's on the pre-rendered version is present, we're just not importing it. We could probably run this through a dm.ModelFromDomConverter and use the data that creates, rather then the sparse data that we're currently using. This would then be consistent.

