Old format:
<span typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"html":"Hello <b>world</b>"}}'>[...]</span>
New format:
<span typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-cite-foo"}}'>[...]</span> [...] <ol typeof="mw:Extension/references"> <li about="#cite_note-3" id="cite_note-3"><span rel="mw:referencedBy">[...]</span> <span id="mw-cite-foo">Hello <b>world</b></span></li> [...] </ol>
For backwards compatibility, both formats should be supported. Changes to reference contents should always be reflected in data-mw.body.html: if a reference using data-mw.body.id is changed, a data-mw.body.html attribute should be added with the new HTML.