escapeDiffTokens function

String escapeDiffTokens(
  1. String text
)

Escape diff tokens — the diff library has issues with & and $.

Implementation

String escapeDiffTokens(String text) {
  return text.replaceAll('&', '\u0000&').replaceAll('\$', '\u0000\$');
}