Wiki Filter

From Okapi Framework
Revision as of 03:57, 24 May 2013 by Amake (talk | contribs) (→‎Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


The Wiki Filter is an Okapi component for extracting translatable text from wiki markup. Currently the only supported style of markup is Dokuwiki.

 === Header ===
  * List item
   * List item
 {{image.jpg|Image caption}}
 ^ Table header 1 ^ Table header 2 |
 | Table cell 1 | Table cell 2 |

Processing Details

Input Encoding

The filter decides which encoding to use for the input document using the following logic:

  • If the file has a Unicode Byte-Order-Mark:
    • Then, the corresponding encoding (e.g. UTF-8, UTF-16, etc.) is used.
  • Otherwise, the input encoding used is the default encoding that was specified when opening the document.

Inline Codes

All Dokuwiki syntax described here is supported.


Prevent the filter from collapsing whitespace by setting preserve_whitespace: true.

You may define custom inline codes as follows:

   - pattern: "REGEX_PATTERN"
   - {start_pattern: "REGEX_PATTERN", end_pattern: "REGEX_PATTERN"}

Specify just pattern for a placeholder tag; specify a start_pattern and end_pattern for opening/closing tag pairs.

Item Description Example value
REGEX_PATTERN Any valid regex that matches non-zero-width runs of text within the comment. Matches will be turned into codes according to the parameters as described above. \[(path|menu)[^\]]*\]


  • Attributes of inline codes (link and image URLs, etc.) are not exposed for translation or special processing.
  • Embedded HTML, PHP, etc., is not extracted.