// packages/block-library/src/code/utils.js
import { pipe } from "@wordpress/compose";
function escape(content) {
  return pipe(
    escapeOpeningSquareBrackets,
    escapeProtocolInIsolatedUrls
  )(content || "");
}
function escapeOpeningSquareBrackets(content) {
  return content.replace(/\[/g, "&#91;");
}
function escapeProtocolInIsolatedUrls(content) {
  return content.replace(
    /^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,
    "$1&#47;&#47;$2"
  );
}
export {
  escape
};
//# sourceMappingURL=utils.js.map
