Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function indexes($text)
- {
- $el = Html::el();
- foreach (Nette\Utils\Strings::split($text, '~((?:\^2)|(?:\^3))~', PREG_SPLIT_OFFSET_CAPTURE) as $part) {
- $el->add($part[0] == '^'
- ? Html::el('sup')->setText(substr($part, 1))
- : Html::el()->setText($part)
- );
- }
- return $el;
- }
Advertisement
Add Comment
Please, Sign In to add comment