Spun-off from: T7984: Edit preview doesn't let you preview cite.php footnotes.
The behavior if the reference is defined outside the section edited is quite disappointing; A warning like <ref> tag with name $1 cannot be previewed because it is defined outside the current section or not defined at all.
This basically occurs in two cases:
- defined inside <references></references>
- defined anywhere else outside the section that is edited
Suggestions that have come up so far to deal with this problem:
- People can use Anomie's ajaxpreview.js (T7984#105262)
- Adding a "Preview full article" option to section previews (T7984#105265)
- Parsing the whole page AND the section and use the references from the page parse, to "fill in the blanks" of the section edit preview. (Disadvantage: performance impact, whereas performance is an oft heard reason to use section editing)
- Use a previously cached version of the references of the current version to amend the context for the section preview. (T7984#1962535). Disadvantage, the 'current' version is not necessarily the version you are editing).