config['generics'] as $_8d36e519) { list($tagName, $regexp, $passthroughIdx, $map) = $_8d36e519; \preg_match_all($regexp, $text, $matches, \PREG_SET_ORDER | \PREG_OFFSET_CAPTURE); foreach ($matches as $m) { $startTagPos = $m[0][1]; $matchLen = \strlen($m[0][0]); if ($passthroughIdx && isset($m[$passthroughIdx]) && $m[$passthroughIdx][0] !== '') { $contentPos = $m[$passthroughIdx][1]; $contentLen = \strlen($m[$passthroughIdx][0]); $startTagLen = $contentPos - $startTagPos; $endTagPos = $contentPos + $contentLen; $endTagLen = $matchLen - ($startTagLen + $contentLen); $tag = $this->parser->addTagPair($tagName, $startTagPos, $startTagLen, $endTagPos, $endTagLen, -100); } else $tag = $this->parser->addSelfClosingTag($tagName, $startTagPos, $matchLen, -100); foreach ($map as $i => $attrName) if ($attrName && isset($m[$i]) && $m[$i][0] !== '') $tag->setAttribute($attrName, $m[$i][0]); } } } }