We currently have 2 parallel code paths for converting da html docs to prosemirror. The main one is in da-collab: aem2doc. This is used for all docs. da-live also has aem2prose, which does the same thing and is used for restoring previous versions of files and for importing templates.
They both do the same thing but use different methods:
- da-live's aem2prose uses dom manipulation
- da-collab aem2doc uses hast manipulation
This causes a lot of pain when making changes as both have to be updated and maintained (and understood).