Function Namespace jQuery.wikiText
Kajabity Wiki Text
Defined in: jquery-wikitext-0.3.js.
Constructor Attributes | Constructor Name and Description |
---|---|
jQuery.wikiText(text)
jQuery Utility Function to convert Wiki formatted text to HTML.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
jQuery.wikiText.re_link
A regular expression which detects HTTP(S) and FTP URLs.
|
<static> |
jQuery.wikiText.re_mail
A regular expression to match an email address with or without "mailto:"
in front.
|
Method Attributes | Method Name and Description |
---|---|
<inner> |
endBlock()
End the current block and, temporarily, any nested inline formatting,
if any.
|
<inner> |
Remove inline formatting at end of a block.
|
<inner> |
formatText(text)
Apply inline formatting to text in a line - and escape any HTML
mark-up tags.
|
<inner> |
getLine()
Get a single line from the input.
|
<static> |
jQuery.wikiText.namedLink(url, name)
Create a HTML link from a URL and Display Text - default the display to
the URL (tidied up).
|
<inner> |
Re-add nested formatting removed at the end of the previous block.
|
<static> |
jQuery.wikiText.safeText(text)
Escape HTML special characters.
|
<inner> |
toggleFormatting(label)
As most inline format tags are the same at the start or end, this
toggles the formatting on or off depending if it is currently in the
tagStack.
|
Function Namespace Detail
jQuery.wikiText(text)
jQuery Utility Function to convert Wiki formatted text to HTML.
- Parameters:
- {string} text
- the Wiki text to be converted to HTML.
- Returns:
- {string} HTML formatted text.
Field Detail
<static>
{RegExp}
jQuery.wikiText.re_link
A regular expression which detects HTTP(S) and FTP URLs.
<static>
{RegExp}
jQuery.wikiText.re_mail
A regular expression to match an email address with or without "mailto:"
in front.
Method Detail
<inner>
{string}
endBlock()
End the current block and, temporarily, any nested inline formatting,
if any.
- Returns:
- {string} the block (and inline formatting) HTML end tags.
<inner>
{string}
endFormatting()
Remove inline formatting at end of a block. Puts it on the
poppedStack to add at the start of the next block.
- Returns:
- {string} end tags for any current inline formatting.
<inner>
{string}
formatText(text)
Apply inline formatting to text in a line - and escape any HTML
mark-up tags.
- Parameters:
- {string} text
- the plain text to be formatted and escaped.
- Returns:
- {string} HTML formatted text.
<inner>
{string}
getLine()
Get a single line from the input. This resolves the issue where the
last line is not returned because it doesn't end with CR/LF.
- Returns:
- {string} a single line of input - or null at end of string.
<static>
{string}
jQuery.wikiText.namedLink(url, name)
Create a HTML link from a URL and Display Text - default the display to
the URL (tidied up).
If the URL is missing, the text is returned, if the Name is missing the URL is tidied up (remove 'mailto:' and un-escape characters) and used as the name.
The name is then escaped using safeText.
- Parameters:
- {string} url
- the URL which may be a full HTTP(S), FTP or Email URL or a relative URL.
- {string} name
- Returns:
- {string} text containing a HTML link tag.
<inner>
{string}
restartFormatting()
Re-add nested formatting removed at the end of the previous block.
- Returns:
- {string} HTML start tags for all continued formatting.
<static>
{string}
jQuery.wikiText.safeText(text)
Escape HTML special characters.
- Parameters:
- {string} text
- which may contain HTML mark-up characters.
- Returns:
- {string} text with HTML mark-up characters escaped.
<inner>
{string}
toggleFormatting(label)
As most inline format tags are the same at the start or end, this
toggles the formatting on or off depending if it is currently in the
tagStack.
- Parameters:
- {string} label
- the name of the format to toggle.
- Returns:
- {string} any HTML start or end tags to toggle the formatting with proper nesting.