If we can introduce helpers/ callbacks like in the D7 filter system, then porting to D7 becomes easier as well as maintaining all branches.

Comments

eric_a’s picture

Status: Active » Needs review
StatusFileSize
new8.99 KB

This patch introduces D7 style functions, which seems doable in this D6 branche. We're passing a fake filter object (process) or no objects at all (tips), but it becomes easier to maintain our code.
The _chessboard_filter_callback() function now gets a filter object passed instead of a format ID. It's a private function, I don't consider this an API change.

eric_a’s picture

StatusFileSize
new9.31 KB
+/**
+ * preg_replace callback to make chessboard diagrams out of chessboard syntax.
  *
  * @param $matches
  *   An array of matches found by preg_replace_callback(). Elements 0 and 1 of
@@ -271,11 +298,11 @@ function chessboard_render_elements(&$el
  * @return
  *   A <code>string

containing the replacement text.
*/
-function _chessboard_filter_callback($matches, $set_format = NULL) {

+/**
+ * preg_replace callback to make chessboard diagrams out of chessboard syntax.
  *
  * @param $matches
  *   An array of matches found by preg_replace_callback(). Elements 0 and 1 of
  *   $matches must be the complete match and the piece placement field.
  *
- * @param $set_format
- *   The text format. This should only be set during a preparatory call before
- *   preg_replace_callback().
+ * @param $set_filter
+ *   The filter object containing settings for the given format. This should
+ *   only be set during a preparatory call before preg_replace_callback().
  *
  * @return
  *   A <code>string

containing the replacement text.
*/
-function _chessboard_filter_callback($matches, $set_format = NULL) {

Status: Needs review » Needs work

The last submitted patch, chessboard-refactor-filter-971014-2.patch, failed testing.

eric_a’s picture

Status: Needs work » Needs review
eric_a’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.