reconstructing references in markup