[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Plugins/Keywords/ -> Parser.js (source)

   1  var regexps  = config.regexps,
   2      tagName  = config.tagName,
   3      attrName = config.attrName;
   4  
   5  var onlyFirst = config.onlyFirst,
   6      keywords  = {};
   7  
   8  regexps.forEach(function(regexp)
   9  {
  10      var m;
  11  
  12      regexp.lastIndex = 0;
  13      while (m = regexp.exec(text))
  14      {
  15          // NOTE: coercing m.index to a number because Closure Compiler thinks pos is a string otherwise
  16          var value = m[0],
  17              pos   = +m['index'];
  18  
  19          if (onlyFirst)
  20          {
  21              if (value in keywords)
  22              {
  23                  continue;
  24              }
  25  
  26              keywords[value] = 1;
  27          }
  28  
  29          addSelfClosingTag(tagName, pos, value.length).setAttribute(attrName, value);
  30      }
  31  });


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1