Does operational transformation work on structured documents such as HTML if simply treated as plain text?

前端 未结 3 1046
温柔的废话
温柔的废话 2021-02-04 03:18

The FAQ of Google Wave Protocol says that [HTML] \"does not have desirable properties\" and that \"HTML makes OT (Operational Transforms) difficult if not impossible\" [1]. Why

3条回答
  •  野的像风
    2021-02-04 03:52

    I don't have a complete answer but I'm interested in seeing more work done on making existing open source operational transformation libraries work with rich text, so I'll contribute what I know.

    The important difference between HTML and the Wave schema seems to be the way text formatting is marked up: a heirarchy of nested tags for HTML vs. out of band annotations (in the footer of the document) with ranges for Wave XML. Out of band annotations are probably a more natural way to mark up text formatting since they allow overlapping (non-nested) formats. It allows something like this (in pseudo-markup), which would not be valid XML using the nested representation:

    (b) This is bold (i) while this range is both bold and italic (/b) and this last bit is just italic (/i)

    Related, here is the relevant issue in the ShareJS project. Perhaps they can implement rich text support by adopting part of the Wave XML schema.

提交回复
热议问题