prefixReference = (prefixGenerator, reference) => {
  if (reference.startsWith('#')) {
    return '#' + prefixId(prefixGenerator, reference.slice(1));
  }
  return null;
}
Insert the prefix in a reference string. A reference string is already
prefixed with #, so the prefix is inserted after the first character.

@param {(id: string) => string} prefixGenerator Function to generate a prefix.
@param {string} reference An arbitrary string, should start with "#".
@returns {?string} The given string with a prefix inserted, or null if the string did not start with "#".