array( t('Paragraphs'), "A single line break\nhas no effect.\n\nBut two line breaks start a new paragraph."), 'h2' => array( t('Headings'), '=='. t('Section') ."==\n". '==='. t('Subsection') ."===\n". '===='. t('Subsection two') ."===="), 'ul' => array( t('Unordered lists'), "* First list item\n* Second list item\n** A nested list item"), 'ol' => array( t('Ordered lists'), "# First list item\n# Second list item\n## A nested list item"), 'dl' => array( t('Definition lists'), ": A term\n; The defenition of that term\n; can span multiple lines\n: Another term\n; And another definition."), 'mix' => array( t('List types can be mixed'), "* A list\n*: Contains a definition \n*; It is both:\n*;# Inside that list, and\n*;# Correctly formated"), 'pre' => array( t('Preformated text'), " If you start with a space\n the formating is preserved"), 'em' => array( t('Emphasis'), "''Emphasized text''"), 'strong'=> array( t('Strong Emphasis'), "'''Strongly emphasized text'''"), ); $header = array(t('Description'), t('You Type'), t('You Get')); foreach($tips as $tip) { $rows[] = array( array('data' => $tip[0], 'class' => 'description'), array('data' => strpos($tip[1],"\n") !== false ? '
'. check_plain($tip[1]) .'' : '
'. check_plain($tip[1]) .'',
'class' => 'type'),
array('data' => autoformat($tip[1]), 'class' => 'get')
);
}
$output = t('Automatic formating of text using the same tags as MediaWiki (wikipedia).');
$output .= t('This table provides examples for each formating tag that is enabled on this site.
'); $output .= theme('table', $header, $rows); return $output; } else { return t('Automatic formating of text using the same tags as MediaWiki (wikipedia).'); } } /** * Implementation of hook_filter(). */ function autoformat_filter($op, $delta = 0, $format = -1, $text = '') { switch ($op) { case 'list': return array( t('Automatic formating') ); case 'description': return t('Automatic formating of text using the same tags as MediaWiki (wikipedia). HTML is untouched.'); case 'process': return autoformat($text); default: return $text; } } ?>