private String markup(int lineNumber, String string) {
		if (lineNumber != marker) {
			return string;
		}

		String flag = " ****** ";
		String[] lines = string.split("\n");
		StringBuilder buffy = new StringBuilder();
		for (String line : lines) {
			if (line.trim().isEmpty()) {
				buffy.append(line).append('\n'); // whitespace
				continue;
			}
			buffy.append(flag).append(line).append(flag).append('\n');
			flag = "        ";
		}

		return buffy.toString();
	}
A class that knows how to traverse a set a lines that are being used to generate a diff.
Ghidra/Features/Base/src/main/java/ghidra/app/util/html/diff/DiffLinesValidator.java