I think you are looking for a solution that can attach metadata to
specific places in the DOM -- there have been other contexts where
this has come up as well. So, I think we need a generic solution
to do this.
That said, Parsoid assigns ids to individual elements in the DOM,
and so, an easy way to do this would be to store this data keyed
on element ids and then looked up this metadata separately.
As for stability, we right now don't guarantee it, but this has
come up previously (
https://phabricator.wikimedia.org/T116350 )
and we haven't tackled it because there hasn't been a compelling
use case that would benefit immediately from it, and we cannot
reliably guarantee that the ids will continue to be stable across
a series of wikitext edits.
But, on a edit-to-edit basis, Parsoid already does dom-diffs and
identifies only the edited portions of the DOM (and this is used
internally to support no-dirty-diff serialization of edited HTML
to wikitext). However, this functionality is not exposed currently
outside of internal Parsoid use.
This doesn't answer your questions directly, but hope this is
atleast in the direction of what you are looking for.
Subbu.
On 10/28/2015 06:31 AM, André Costa wrote: