private static List<CommentPart> doParseTextIntoParts(String text,
			Function<Annotation, Annotation> fixerUpper, Program program) {

		List<CommentPart> results = new ArrayList<>();

		List<WordLocation> annotations = getCommentAnnotations(text);
		if (annotations.isEmpty()) {
			results.add(new StringCommentPart(text));
			return results;
		}

		// split the text into pieces of normal text and annotated
		int offset = 0;
		for (WordLocation word : annotations) {

			int start = word.getStart();
			if (offset != start) {
				// text between annotations
				String preceding = text.substring(offset, start);
				results.add(new StringCommentPart(preceding));
			}

			String annotationText = word.getWord();
			Annotation annotation = new Annotation(annotationText, program);
			annotation = fixerUpper.apply(annotation);
			results.add(new AnnotationCommentPart(annotationText, annotation));

			offset = start + annotationText.length();
		}

		if (offset != text.length()) { // trailing text
			String trailing = text.substring(offset);
			results.add(new StringCommentPart(trailing));
		}

		return results;
	}
Split the given text into parts where the returned list contains either a String or 
an Annotation

@param text the text to parse
@param fixerUpper a function that is given a chance to convert an Annotation into a new one
@param program the program
@return a list that contains a mixture String or an Annotation entries
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/CommentUtils.java