Wiki Text Plugin for jQuery
The Wiki Text plugin for jQuery enables plain text to be converted to HTML using very simple Wiki style markup.
The plugin provides the following features: -
- $.wikiText( plaintext ) - a jQuery utility function to convert Wiki formatted 'plaintext' to HTML.
- $.fn.wikiText( plaintext ) - a jQuery wrapper function to add Wiki formatted text to a DOM object.
In addition, one or two constants and functions have been made accessible from the plugin - view the JsDoc output for more details.
You can try out the plugin on the Wiki Test page and see the results in real time (it's quite fast, too).
Wiki Text is a very simple textual mark-up syntax used for generating web pages. It is designed to be easy for non-technical users to write and edit and still produce rich, structured HTML content.
The Wiki format is converted to simple, clean HTML - it is then up to the page's CSS styling to determine how the HTML is presented.
This plugin was originally developed to enable structured mark-up for Google Calendar event descriptions - which only allows plain text (i.e. no styling). But using Wiki format enables the text to be easy to read and maintained within the Google Calendar interface while still presenting fully marked up HTML when embedded in other web pages.
See the Google Calendar posts for more details.
Wiki Text is:
- easy to read - so ideal for text which non-technical people will read
- easy to learn - a really simple syntax which is quite forgiving of mistakes
- safe to use - the simple text markup and escaping of any HTML elements means that there are no nasty surprises when the output is rendered.
The Wiki Text Plugin for JQuery supports a the following common Wiki syntax features: -
- Paragraphs, block quotes and pre-formatted text.
- Bulleted and numbered lists.
- Bold, italic, underline, monospace, strikethrough, superscript and subscript character formatting.
- FTP, HTTP(S) and email links - including named links.
- Horizontal Rules.
- Forced line breaks.
I plan to include more features in future releases - tables, hierarchical lists and so on.