From d11dad30558802a52d5e8656e33a1baaacc80b08 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 16:00:25 +0000 Subject: [PATCH] sup/sub support in bbcode --- ext/bbcode/main.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index 843e03f0..e0e35fb3 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -15,6 +15,8 @@ *
  • [i]italic[/i] *
  • [u]underline[/u] *
  • [s]strikethrough[/s] + *
  • [sup]superscript[/sup] + *
  • [sub]subscript[/sub] *
  • [[wiki article]] *
  • [[wiki article|with some text]] *
  • [quote]text[/quote] @@ -34,6 +36,8 @@ class BBCode extends FormatterExtension { $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text); $text = preg_replace("/\[s\](.*?)\[\/s\]/s", "\\1", $text); + $text = preg_replace("/\[sup\](.*?)\[\/sup\]/s", "\\1", $text); + $text = preg_replace("/\[sub\](.*?)\[\/sub\]/s", "\\1", $text); $text = preg_replace("/>>(\d+)(#c?(\d+))?/s", ">>\\1\\2", $text); $text = preg_replace("/(^|\s)#(\d+)/s", "\\1#\\2", $text); $text = preg_replace("/>>([^\d].+)/", "
    \\1
    ", $text);