Feature summary (what you would like to be able to do and where):
JavaScript and CSS code should be able to reliably detect when Parsoid HTML is being used and what version is being used so it can adapt accordingly to signficant breaking changes while still being backwards compatible. The solution should meet the following criteria:
- Should be possible to target styles at Parsoid HTML or legacy parser HTML via a single CSS selector e.g. [data-parsoid] a
- Should be possible to target styles at a specific version of Parsoid
- Should be possible to check whether Parsoid HTML is being returned in JavaScript
- Should be possible to get Parsoid version by reading HTML in JavaScript
Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
- Handling breaking changes to the HTML
- Migrating section collapsing code on MobileFrontend
Benefits (why should this be implemented?):
- Easier to roll back changes safely when issues occur
- Easier to prepare for changes prior to issues occurring.