import { checkEmphasis as l } from "../util/check-emphasis.es.js";
import { encodeCharacterReference as h } from "../util/encode-character-reference.es.js";
import { encodeInfo as d } from "../util/encode-info.es.js";
k.peek = C;
function k(c, p, o, n) {
  const r = l(o), u = o.enter("emphasis"), t = o.createTracker(n), i = t.move(r);
  let e = t.move(
    o.containerPhrasing(c, {
      after: r,
      before: i,
      ...t.current()
    })
  );
  const s = e.charCodeAt(0), a = d(
    n.before.charCodeAt(n.before.length - 1),
    s,
    r
  );
  a.inside && (e = h(s) + e.slice(1));
  const f = e.charCodeAt(e.length - 1), m = d(n.after.charCodeAt(0), f, r);
  m.inside && (e = e.slice(0, -1) + h(f));
  const b = t.move(r);
  return u(), o.attentionEncodeSurroundingInfo = {
    after: m.outside,
    before: a.outside
  }, i + e + b;
}
function C(c, p, o) {
  return o.options.emphasis || "*";
}
export {
  k as emphasis
};
//# sourceMappingURL=emphasis.es.js.map
