Pairs tree nodes with drawn text by what the text says.
Diagrams that draw their labels with no id to find them by -- an Ishikawa
diagram, a tree view, a timeline -- still draw each label once, so a node
is paired with the first unpaired element whose text matches its name.
Whitespace is ignored, because a long label is wrapped across lines.
Parameters
candidates: Element[]
The elements that could carry labels, in document order
Pairs tree nodes with drawn text by what the text says.
Diagrams that draw their labels with no id to find them by -- an Ishikawa diagram, a tree view, a timeline -- still draw each label once, so a node is paired with the first unpaired element whose text matches its name. Whitespace is ignored, because a long label is wrapped across lines.