public static String fixupAnnotations(String rawCommentText, Program program) {

		if (rawCommentText == null) {
			return null;
		}

		// this function will take any given Symbol annotations and change the text, replacing
		// the symbol name with the address of the symbol
		Function<Annotation, Annotation> symbolFixer = annotation -> {

			String[] annotationParts = annotation.getAnnotationParts();
			AnnotatedStringHandler handler = getAnnotationHandler(annotationParts);
			if (!(handler instanceof SymbolAnnotatedStringHandler)) {
				return annotation; // nothing to change
			}

			String rawText = annotation.getAnnotationText();
			String updatedText =
				convertAnnotationSymbolToAddress(annotationParts, rawText, program);
			if (updatedText == null) {
				return annotation; // nothing to change
			}

			return new Annotation(updatedText, program);
		};

		StringBuilder buffy = new StringBuilder();
		List<CommentPart> parts = doParseTextIntoParts(rawCommentText, symbolFixer, program);
		for (CommentPart part : parts) {
			buffy.append(part.getRawText());
		}
		return buffy.toString();
	}
Makes adjustments as necessary to any annotations in the given text.

@param rawCommentText the text to be updated
@param program the program associated with the comment
@return the updated string
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/CommentUtils.java