function f(l) {
  let t, n, o = 0;
  const e = l.tokens, s = l.tokens.length;
  for (t = n = 0; t < s; t++)
    e[t].nesting < 0 && o--, e[t].level = o, e[t].nesting > 0 && o++, e[t].type === "text" && t + 1 < s && e[t + 1].type === "text" ? e[t + 1].content = e[t].content + e[t + 1].content : (t !== n && (e[n] = e[t]), n++);
  t !== n && (e.length = n);
}
export {
  f as default
};
