Wiki formatting: Headings: tolerate spaces after line; added disable_rule method (required for rev. 1029)
--- a/includes/wikiengine/parse_mediawiki.php Thu Jul 02 08:58:54 2009 -0400
+++ b/includes/wikiengine/parse_mediawiki.php Thu Jul 02 09:00:52 2009 -0400
@@ -59,7 +59,7 @@
public function heading(&$text)
{
- if ( !preg_match_all('/^(={1,6}) *(.+?) *\\1$/m', $text, $results) )
+ if ( !preg_match_all('/^(={1,6}) *(.+?) *\\1 *$/m', $text, $results) )
return array();
$headings = array();
--- a/includes/wikiformat.php Thu Jul 02 08:58:54 2009 -0400
+++ b/includes/wikiformat.php Thu Jul 02 09:00:52 2009 -0400
@@ -291,6 +291,25 @@
}
/**
+ * Disable a render stage
+ * @param string stage
+ * @return null
+ */
+
+ public function disable_rule($rule)
+ {
+ foreach ( $this->rules as $i => $current_rule )
+ {
+ if ( $current_rule === $rule )
+ {
+ unset($this->rules[$i]);
+ return null;
+ }
+ }
+ return null;
+ }
+
+ /**
* Generate a token
* @param int Token index
* @return string