Parser für in bodytext-Feldern $splitContent = preg_split('|(]*>[^<]+)|', $content, -1, PREG_SPLIT_DELIM_CAPTURE); $content = ''; foreach ($splitContent as $part) { if (substr($part, 0, 5) === '[^\s>]+)(?:\s(?P[^\s>]+))?(?:\s(?P[^\s>]+))?(?:\s"(?P[^">]+)")?>(?P<linktext>[^<]*)</link>|xui', $part, $matches); if ($matches !== array()) { $content .= '<a href="' . $matches['linkend'] . '"'; if ($matches['target'] !== '' && $matches['target'] !== '-'&& $matches['target'] !== 'page') { // popup creation is not supported if (strpos($matches['target'], 'x') === FALSE) { $content .= ' target="' . $matches['target'] . '"'; } } if ($matches['class'] !== '') { $content .= ' class="' . $matches['class'] . '"'; } if ($matches['title'] !== '') { $content .= ' title="' . $matches['title'] . '"'; } $content .= '>' . $matches['linktext'] . '</a>'; } else { $content .= $part; } } else { $content .= $part; } }