Public Member Functions | |
| AnewtTextile () | |
| Constructor method. | |
| process ($text) | |
| Processes the text. | |
Private Member Functions | |
| _normalize_text ($text) | |
| Normalize text by cleaning up newlines and whitespace. | |
| _split_into_blocks ($text) | |
| Splits text into blocks. | |
| _parse_block ($text) | |
| Parse a block of text with optional modifiers. | |
| _parse_list ($text) | |
| Parse a block of text into a list structure. | |
| _process_block ($text) | |
| Process a single block of text. | |
| _build_html_block_element ($tag_name, $parsed_block) | |
| Build a block level HTML element with the specified properties. | |
| _format_paragraph ($parsed_block) | |
| Formats a single paragraph. | |
| _format_blockquote ($parsed_block) | |
| Format a block quote. | |
| _format_header ($parsed_block) | |
| Formats a header block. | |
| _format_list ($items, $type=null) | |
| Format a list block. | |
| _format_inline ($inline) | |
| Format inline text. | |
Private Attributes | |
| $_saved_block_modifiers = array() | |
| The block modifiers used in block continuation mode, if enabled. | |
This class transforms input text in textile format into valid XHTML strict.
The Textile class has several attributes to control the behaviour of the engine.
line-folding: Boolean indicating whether to enable line folding (enabled by default). In line folding mode, you can include newline characters in your input text. These newlines will not be used as line wraps. If line folding is off, every newline in the input text is treated as the start of a new block. This setting is compatible with other Textile implementations.The above attributes can be queried and set using the standard AnewtContainer::get and AnewtContainer::set methods.
Definition at line 125 of file textile.lib.php.
| AnewtTextile::AnewtTextile | ( | ) |
Constructor method.
Initialises the default settings.
Definition at line 133 of file textile.lib.php.
| AnewtTextile::_normalize_text | ( | $ | text | ) | [private] |
Normalize text by cleaning up newlines and whitespace.
| $text | The text string to normalize |
Definition at line 152 of file textile.lib.php.
| AnewtTextile::_split_into_blocks | ( | $ | text | ) | [private] |
Splits text into blocks.
The input text is split into blocks that can be separately formatted. Both line folded and non-line folded text is handled, as well as lists, tables en pre-formatted code.
| $text | Text to split into blocks |
Definition at line 176 of file textile.lib.php.
| AnewtTextile::_parse_block | ( | $ | text | ) | [private] |
Parse a block of text with optional modifiers.
| $text | A block of text |
Definition at line 212 of file textile.lib.php.
| AnewtTextile::_parse_list | ( | $ | text | ) | [private] |
Parse a block of text into a list structure.
If this block is not a list NULL is returned.
| $text | The text to parse into a list. |
Definition at line 313 of file textile.lib.php.
| AnewtTextile::_process_block | ( | $ | text | ) | [private] |
Process a single block of text.
This method detects the type of block and formats it accordingly. It detects headers, paragraphs, block quotes, lists, tables and preformatted code.
| $text | The input text, e.g. obtained using from _split_into_blocks. |
Definition at line 362 of file textile.lib.php.
| AnewtTextile::_build_html_block_element | ( | $ | tag_name, | |
| $ | parsed_block | |||
| ) | [private] |
Build a block level HTML element with the specified properties.
| $tag_name | The name of the XHTML tag that should be created. Only a few block-level tags can be handled. | |
| $parsed_block | A parsed block |
Definition at line 423 of file textile.lib.php.
| AnewtTextile::_format_paragraph | ( | $ | parsed_block | ) | [private] |
Formats a single paragraph.
This method will format a paragraph, processing several optional markup attributes.
| $parsed_block | A parsed block |
Definition at line 532 of file textile.lib.php.
| AnewtTextile::_format_blockquote | ( | $ | parsed_block | ) | [private] |
Format a block quote.
| $parsed_block | A parsed block instance |
Definition at line 549 of file textile.lib.php.
| AnewtTextile::_format_header | ( | $ | parsed_block | ) | [private] |
Formats a header block.
This method will format a paragraph, processing several optional markup attributes.
| $parsed_block | A parsed block |
Definition at line 567 of file textile.lib.php.
| AnewtTextile::process | ( | $ | text | ) |
Processes the text.
This method will transform the input text into XHTML, thereby converting headers, paragraphs, lists, block quotes and other block elements into their corresponding XHTML tags. Hyperlinks, inline markup (like emphasized or strong words), images and code is also converted. Additionally, several typographic enhancements are made to inline text (curly quotes, em dashes, entity replacements, etc).
| $text | Input text in Textile format |
Definition at line 772 of file textile.lib.php.
1.5.9