In T385666: Show references with the same details as re-use in the legacy rendering (Merge Use Case) we implemented a first version (in the legacy parser) for how identical sub-references can be merged a.k.a. "reused". This is a very new code path with a very new merge mechanism, different from how main refs can be reused.
We need to make sure this new code path doesn't break existing, well-defined behaviors. Or if it does, that we are fine with the new (emergent) behavior.
Affected edge-case:
- How should dir="rtl" behave on an identical sub-ref when it conflicts with the same attribute on a previous sub-ref, or the same attribute on the main ref?
- Works as expected in the legacy parser because the relevant check happens earlier than the merge.
- We might want to block the dir=… attribute entirely on a ref like <ref name="a" details="p. 2" dir="rtl" /> when there is no main content it could apply to. Is this worth it?
- Check Parsoid for the edge case above: no error is displayed
- follow= should already fail when used together with details=, so probably doesn't cause new problems here.
- As expected.
- Check Parsoid for the edge case above: error is displayed next to subref & marker is rendered - this differs from legacy
- Let's say there are two identical <ref name="a" details="p. 2">The book</ref> with identical details, but one with a typo in the main content. Does this typo still cause the expected error?
- Works as expected in the legacy parser because the relevant check happens earlier than the merge.
- Check Parsoid for the edge case above: Other than in legacy the error shows up next to the subref and not next to the mainref.
We also need make sure all these cases behave the same in both parsers.
- Test coverage, see https://gerrit.wikimedia.org/r/1196399
- Check https://en.wikipedia.beta.wmcloud.org/wiki/CiteDetailsExamples For legacy parser ( looks fine )
- Check https://en.wikipedia.beta.wmcloud.org/wiki/CiteDetailsExamples For Parsoid parser ( TBD ): all error messages are shown next to the subref and not in the article or next to the main ref.
Open questions
- Should Parsoid also display errors next to the main ref?
- Do we want to block the dir attribute when used together with details?
- Should we not render a marker and display an error when details and follow are being used together?