Support replacement within diagrams, whitespace preservation