code: function mergeAttributes(from, to) {
      mergeClassNames(from, to);
  
      // It’s important to preserve attributes order: ones in `from` have higher
      // priority than in `to`. Collect attributes in map in order they should
      // appear in `to`
      const attrMap = new Map();
  
      let attrs = from.attributes;
      for (let i = 0; i < attrs.length; i++) {
          attrMap.set(attrs[i].name, attrs[i].clone());
      }
  
      attrs = to.attributes.slice();
      for (let i = 0, attr, a; i < attrs.length; i++) {
          attr = attrs[i];
          if (attrMap.has(attr.name)) {
              a = attrMap.get(attr.name);
              a.value = attr.value;
  
              // If user explicitly wrote attribute in abbreviation, it’s no longer
              // implied and should be outputted even if value is empty
              if (a.options.implied) {
                  a.options.implied = false;
              }
          } else {
              attrMap.set(attr.name, attr);
          }
  
          to.removeAttribute(attr);
      }
  
      const newAttrs = Array.from(attrMap.values());
      for (let i = 0; i < newAttrs.length; i++) {
          to.setAttribute(newAttrs[i]);
      }
  
      return to;
  }
docs: Transfer attributes from first element to second one and preserve first
  element’s attributes order
  @param  {Node} from
  @param  {Node} to
  @return {Node}