import { normalizeUri } from "../micromark-util-sanitize-uri/index.js";
function link(state, node) {
  const properties = { href: normalizeUri(node.url) };
  if (node.title !== null && node.title !== void 0) {
    properties.title = node.title;
  }
  const result = {
    type: "element",
    tagName: "a",
    properties,
    children: state.all(node)
  };
  state.patch(node, result);
  return state.applyData(node, result);
}
export {
  link
};
//# sourceMappingURL=lib-handlers-link.js.map
