"Old Default Parser", "version" => "0.10", "author" => "Johnny Broadway & Starbeamrainbowlabs", "description" => "The *old* default parser for Pepperminty Wiki. Based on Johnny Broadway's Slimdown (with more than a few modifications). This parser's features are documented in the help page. Superceded by a customised extension of parsedown extra.", "id" => "parser-default-old", "optional" => true, "code" => function() { global $settings; add_parser("default", function($markdown) { return Slimdown::render($markdown); }); // Register the help section if($settings->parser != "default") return; // Don't register the help section if we aren't the currently set parser. add_help_section("20-parser-default", "Editor Syntax", "

$settings->sitename's editor uses a modified version of slimdown, a flavour of markdown that is implementated using regular expressions. See the credits page for more information and links to the original source for this. A quick reference can be found below:

Type ThisTo get this
_italics_italics
*bold*bold
~~Strikethrough~~Strikethough
`code`code
# Heading

Heading

## Sub Heading

Sub Heading

[[Internal Link]]Internal Link
[[Display Text|Internal Link]]Display Text
[Display text](//google.com/)Display Text
> Blockquote
> Some text
Blockquote
Some text
- Apples
* Oranges
  • Apples
  • Oranges
1. This is
2. an ordered list
  1. This is
  2. an ordered list
---
![Alt text](//starbeamrainbowlabs.com/favicon-small.png)Alt text

In addition, the following extra syntax is supported for images:

Size the image to at most 250 pixels wide:
	![Alt text](//starbeamrainbowlabs.com/favicon-small.png 250px)
	
	Size the image to at most 120px wide and have it float at the right ahnd size of the page:
	![Alt text](//starbeamrainbowlabs.com/favicon-small.png 120px right)
"); } ]); /*********************************************************************** * ███████ ██ ██ ███ ███ ██████ ██████ ██ ██ ███ ██ * * ██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ████ ██ * * ███████ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ █ ██ ██ ██ ██ * * ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ * * ███████ ███████ ██ ██ ██ ██████ ██████ ███ ███ ██ ████ * ***********************************************************************/ /** * Slimdown - A very basic regex-based Markdown parser. Supports the * following elements (and can be extended via Slimdown::add_rule()): * * - Headers * - Links * - Bold * - Emphasis * - Deletions * - Quotes * - Inline code * - Blockquotes * - Ordered/unordered lists * - Horizontal rules * * Author: Johnny Broadway * Website: https://gist.github.com/jbroadway/2836900 * License: MIT */ /** * Modified by Starbeamrainbowlabs (starbeamrainbowlabs) * * Changed bold to use single asterisks * Changed italics to use single underscores * Added one to add the heading levels (no

tags allowed) * Added wiki style internal link parsing * Added wiki style internal link parsing with display text * Added image support */ class Slimdown { public static $rules = array ( '/\r\n/' => "\n", // new line normalisation '/^(#+)(.*)/' => 'self::header', // headers '/(\*+)(.*?)\1/' => '\2', // bold '/(_)(.*?)\1/' => '\2', // emphasis '/!\[(.*)\]\(([^\s]+)\s(\d+.+)\s(left|right)\)/' => '\1', // images with size '/!\[(.*)\]\(([^\s]+)\s(\d+.+)\)/' => '\1', // images with size '/!\[(.*)\]\((.*)\)/' => '\1', // basic images '/\[\[([a-zA-Z0-9\_\- ]+)\|([a-zA-Z0-9\_\- ]+)\]\]/' => '\2', //internal links with display text '/\[\[([a-zA-Z0-9\_\- ]+)\]\]/' => '\1', //internal links '/\[([^\[]+)\]\(([^\)]+)\)/' => '\1', // links '/\~\~(.*?)\~\~/' => '\1', // del '/\:\"(.*?)\"\:/' => '\1', // quote '/`(.*?)`/' => '\1', // inline code '/\n\s*(\*|-)(.*)/' => 'self::ul_list', // ul lists '/\n[0-9]+\.(.*)/' => 'self::ol_list', // ol lists '/\n(>|\>)(.*)/' => 'self::blockquote', // blockquotes '/\n-{3,}/' => "\n
", // horizontal rule '/\n([^\n]+)\n\n/' => 'self::para', // add paragraphs '/<\/ul>\s?