Last updated 4 February 2008. Created on 2 February 2008.
Edited by birdmanx35. Log in to edit this page.

Flexifilter currently ships with a wiki format, but let's step through it so you can understand how it works.

  1. Go to the flexifilter administration area by clicking Administer -> Site Building -> Flexifilters, and click 'Add new flexifilter'.
  2. Set the label to 'Wiki'.
  3. Set the description to 'A flexifilter for a wiki'.
  4. Prepend with </nowiki>.
  5. Append with <nowiki>
  6. Do a chunk grab on </nowiki> and <nowiki>.
  7. Add several pattern-based text replace components:
  8. Replace ''' (three single dashes) with alternating <strong> and </strong>.
  9. Replace '' (two single dashes) with alternating <em> and </em>.
  10. Replace ==== (four equals signs) with alternating <h4> and </h4>
  11. Replace === (three equals signs) with alternating <h3> and </h3>
  12. Replace == (two equals signs) with alternating <h2> and </h2>
  13. Create a chunk grabber on [[ and ]].
  14. Add an IF component within the chunk grabber.
  15. Add the condition "text contains" with the parameter |.
  16. As subcomponents of this IF statement, prepend with <a href="/drupalwikipath/
  17. String replace | with ">.
  18. Append </a>.
  19. Now, outside the if statement, create an IF NOT statement with the same condition.
  20. String replace ~ with \~ (escape the character).
  21. Append ~~.
  22. Add an advanced append. Step 20 should be added to this component.
  23. String replace ~~ with </a>.
  24. Now, outside of the advanced append, prepend with <a href="/drupalwikipath/
  25. String replace ~~ with ">
  26. String replace \~ with ~.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

amitaibu’s picture

Shouldn't section 6 be:
"Do a chunk grab on start = <nowiki> and end = </nowiki>." (i.e. move the </nowiki> to the start)?

---
amitaibu.com

wayland76’s picture

Doesn't do lists or tables.

-=-=-=-
http://www.jdarx.info/

fda’s picture

There is a set of problems here.

The first is for lists within lists. My guess is that you have to treat separately each level, and therefore test "***", then "**", then "* " if you want to treat up to three levels. The same for "###", "##" and "#". Or - worse - combinations of them : #* and the like, if they are supposed to be allowed.

A second one is that these stars (or "#", for ordered lists) are meaningful to make lists only if they appear at the start of a line, optionally preceded by one or more ":" (tab), which have to be interpreted too.

A third is that while it is probably easy enough to spot the first < li > to generate and to precede it with < ul > or < ol >, spotting the place where < eul > shoud be inserted is a bit more tricky.

Just my two cents, at the time :-(

quagmire’s picture

I'm still fairly new to Drupal, so this might seem a silly question: for Step 8 (and similar steps) -- "Replace ''' (three single dashes) with alternating and ." -- do I need to add a text replace component for and one for or do I add the opening and closing tag in one text replace field? Thanks.

risca’s picture

Please follow the following discussion: http://drupal.org/node/212417