import { normalizeUri as f } from "../../../../../micromark-util-sanitize-uri@2.0.1/node_modules/micromark-util-sanitize-uri/index.js";
import { revert as o } from "../revert.js";
function m(i, e) {
  const l = String(e.identifier).toUpperCase(), t = i.definitionById.get(l);
  if (!t)
    return o(i, e);
  const r = { href: f(t.url || "") };
  t.title !== null && t.title !== void 0 && (r.title = t.title);
  const n = {
    type: "element",
    tagName: "a",
    properties: r,
    children: i.all(e)
  };
  return i.patch(e, n), i.applyData(e, n);
}
export {
  m as linkReference
};
//# sourceMappingURL=link-reference.js.map
