Fix bug in the `diagrams` tool where cross-reference diagrams would not display external entities correctly