function delveIfClassName(scope, className) {
  if (!className) return scope

  let tail = scope.children[scope.children.length - 1]

  if (
    !tail ||
    tail.type !== 'element' ||
    !tail.properties ||
    !Array.isArray(tail.properties.className) ||
    !tail.properties.className.includes(className)
  ) {
    tail = {
      type: 'element',
      tagName: 'span',
      properties: {className: [className]},
      children: []
    }
    scope.children.push(tail)
  }

  return tail
}
@param {Element | Root} scope
  Node to work in.
@param {string | undefined} className
  Class to add.
@returns {Element | Root}
  The new element, if with `className`, or the given `scope`.