Make WordPress Core

Ticket #31242: 31242.13.patch

File 31242.13.patch, 1.3 KB (added by iseulde, 10 years ago)
  • src/wp-includes/js/twemoji.js

     
    11/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */
    2 var twemoji;
    3 twemoji = (function (
     2var twemoji = (function (
    43  /*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//*
    54    https://github.com/twitter/twemoji/blob/gh-pages/LICENSE
    65  */
     
    327326    var
    328327      allText = grabAllTextNodes(node, []),
    329328      length = allText.length,
     329      modified = false,
    330330      fragment,
    331331      subnode,
    332332      text,
     
    367367            img.setAttribute('draggable', 'false');
    368368            img.alt = alt;
    369369            img.src = src;
     370            modified = true;
     371            fragment.appendChild(img);
    370372          }
    371373        }
    372         fragment.appendChild(img || createText(alt));
     374        if (!img) fragment.appendChild(createText(alt));
     375        img = null;
    373376      }
    374377      // is there actually anything to replace in here ?
    375       if (img) {
    376         img = null;
     378      if (modified) {
    377379        // any text left to be added ?
    378380        if (i < text.length) {
    379381          fragment.appendChild(
     
    516518    return r.join(sep || '-');
    517519  }
    518520
    519 }());
     521}());
     522 No newline at end of file