[Home]CommonMarkup

UseModWiki | RecentChanges | Preferences

UseModWiki/Documentation and the Functions

General Description of function:

Parses the HTML tags and WikiTags? in the given text. The other input parameters, $useImage and $doLines, are used to adjust the behaviour as this function is called from several places.

Given input:

$text
The text to be parsed.
$useImage
Renders the URLs of images as images if set to TRUE. The global variable $ImageExtensions is used to determine which URLs point to images.
$doLines
0: Does not parse the double or triple single quote WikiTags? nor the heading tag (n equal signs). 1: Parses just a few HTML tags which must be on a single line. The tags are <b>, <i>, <strong> and <em>. 2: Parses all HTML tags, also the ones spanning multiple lines. All tags means the ones defined in @HtmlPairs and @HtmlSingle, and the <pre> and <code> tags. Also the <nowiki> tag is parsed in this case.

Returns results:

Returns the parsed text which is more or less pure HTML, depending on the parameters.

Notes:

I'm not really sure what $doLines is for. It doesn't seem to be an option you are encouraged to change. Anyone know why? What are the advantages / disadvantages to line-by-line processing?

$doLines is for old WardsWiki style "quote markup". Two single quotes is italic, three is bold, five is both. I'm not sure UseModWiki does the old six single quote thing, but it wouldn't need to anyway.

Like this:

*''Italic''
*'''Bold'''
*'''''Both'''''

which renders to

It seems to me that the above description of $doLines is at best inaccurate. Looking at the code, $doLines == 2 will only parse quote markup and headings, $doLines == 0 will parse everything except those things, and $doLines == 1 will parse everything. I can't understand why this behaviour is at all useful, nor why quote markup is special in this respect. -- Phil P.


UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 23, 2007 7:11 pm by MarkusLude (diff)
Search: