- Bold And Italics
- Headings
- Links
- Paragraphs
- Line Breaks
- Lists
- Horizontal Line
- Images
- Tables
- Preformatted And Nowiki
- Escape
- Placeholder
- Creole Additions

Creole Test

Dieser Text wird als Wiki Creole angezeigt und ist mit Hilfe von PHP und Regulären Ausdrücken quasi ein Einzeiler!
[ reference ]

Bold And Italics

Bold

**bold**
bold

Italics

//italics// 
italics

Bold Italics

Bold and italics should //be
able// to cross lines.

But, should //not be...

...able// to cross paragraphs.
Bold and italics should be able to cross lines.

But, should //not be...

...able// to cross paragraphs.
//**bold italics**//
**//bold italics//**
//This is **also** good.//
bold italics bold italics This is also good.

Bold and/or italic links

//[[Important page|this link is italic]]//
**[[Important page]]**
//**[[Important page]]**//
this link is italic Important page Important page

Bold, Italics, Links, Pre in Lists

* **bold** item
* //italic// item
# item about a [[certain page]]
# {{{ //this// is **not** [[processed]] }}}
  1. item about a certain page
  2. //this// is **not** [[processed]] 


[ reference ]

Headings

= Level 1 (largest) =
== Level 2 ==
=== Level 3 ===
==== Level 4 ====
===== Level 5 =====
====== Level 6 ======

Level 1 (largest)

Level 2

Level 3

Level 4

Level 5
Level 6

=== Also level 3
=== Also level 3 =
=== Also level 3 ==
=== **not** //parsed// ===

Also level 3

Also level 3

Also level 3

**not** //parsed//


Unacceptable

== Heading with [[link]]
== Heading with **bold** or //italics//
== Heading with {{Image:image|image}}
== Heading with placeholder

Heading with [[link]]

Heading with **bold** or //italics//

Heading with {{Image:image|image}}

Heading with placeholder



[ reference ]

Links

[[link]]
[[MyBigPage|Go to my page]]
[[http://www.wikicreole.org/]]
http://www.rawlink.org/, http://www.another.rawlink.org
[[http://www.wikicreole.org/|Visit the WikiCreole website]]
[[Weird Stuff|**Weird** //Stuff//]]
[[Ohana:WikiFamily]]
link Go to my page http://www.wikicreole.org/ http://www.rawlink.org/, http://www.another.rawlink.org Visit the WikiCreole website Weird Stuff Ohana:WikiFamily

[ reference ]

Paragraphs

This is my text.

This is more text.
This is my text.

This is more text.

[ reference ]

Line Breaks

This is the first line,\\and this is the second.
This is the first line,
and this is the second.

[ reference ]

Lists

Unordered Lists

* Item 1
* Item 2

Ordered Lists

# Item 1
# Item 2
  1. Item 1
  2. Item 2

Nesting

* Item 1
* Item 2
** Item 2.1
** Item 2.2

Mixing

* Item 1
* Item 2
## Item 2.1
## Item 2.2

Leading Whitespace

* Item 1
* Item 2
** Item 2.1
** Item 2.2


[ reference ]

Horizontal Line

----



[ reference ]

Images

{{myimage.jpg}}

{{myimage.jpg|this is the alt text for my image}}
this is the alt text for my image
[[some link|{{myimage.jpg}}]] - if you click on the image, will goto "some link"
- if you click on the image, will goto "some link"
[[http://example.com/|{{myimage.jpg}}]] - same as above: picture links to url
- same as above: picture links to url

[ reference ]

Tables

|=Heading Col 1 |=Heading Col 2         |
|Cell 1.1 |Two lines\\in Cell 1.2 |
|Cell 2.1 |Cell 2.2 |

Heading Col 1Heading Col 2
Cell 1.1Two lines
in Cell 1.2
Cell 2.1Cell 2.2

Simple table

|Cell 1.1       |Cell 1.2
|Cell 2.1 |Cell 2.2

Cell 1.1Cell 1.2
Cell 2.1Cell 2.2

Table rows ending with | are optional.

|Cell 1.1 | Cell 1.2 |
|Cell 2.1 | Cell 2.2 |

Cell 1.1Cell 1.2
Cell 2.1Cell 2.2

Table with heading

|=Heading Col 1 |=Heading Col 2
|Cell 1.1 |Cell 1.2
|Cell 2.1 |Cell 2.2

Heading Col 1Heading Col 2
Cell 1.1Cell 1.2
Cell 2.1Cell 2.2

Table with forced line break using the \\ syntax

|=Heading Col 1                         |= Heading Col 2
|Cell 1.1 line one \\ Cell 1.1 line two | Cell 1.2

Heading Col 1Heading Col 2
Cell 1.1 line one
Cell 1.1 line two
Cell 1.2


[ reference ]

Preformatted And Nowiki

{{{
//This// does **not** get [[formatted]]
}}}
//This// does **not** get [[formatted]] 

Some examples of markup are: {{{** <i>this</i> ** }}}
Some examples of markup are:
** <i>this</i> ** 

Closing braces in nowiki

{{{
{{if (a>b) { b = a; }}}
}}}
{{if (a>b) { b = a; }}}

{{{
if (x != NULL) {
for (i = 0; i < size; i++) {
if (x[i] > 0) {
x[i]--;
}}}
}}}
if (x != NULL) {
for (i = 0; i < size; i++) {
if (x[i] > 0) {
x[i]--;
}}}


[ reference ]

Escape

~#1
http://www.foo.com/~bar/
~http://www.foo.com/
CamelCaseLink
~CamelCaseLink
#1 http://www.foo.com/~bar/ http://www.foo.com/ CamelCaseLink CamelCaseLink

[ reference ]

Placeholder




[ reference ]

Creole Additions

Plug-in/Extension

<<CurrentTimePlugin format='yyyy.MM.dd'>>
yyyy.MM.dd

Monospace

This is ##monospace## text.
This is monospace text.

Superscript

This is ^^superscripted^^ text.
This is superscripted text.

Subscript

This is ,,subscripted,, text.
This is subscripted text.

Underline

This is __underlined__ text.
This is underlined text.

Alternate Link Syntax

[[description -> link]]
[[the -> can be used to make a link -> TextFormattingRules]]
description the -> can be used to make a link

Indented paragraphs

This is a normal paragraph.
:This is an indented
paragraph in two lines.
::This is more indented.
This is a normal paragraph.
This is an indented paragraph in two lines.
This is more indented.

This is a normal paragraph.
>This is an indented
paragraph in two lines.
>>This is more indented.
This is a normal paragraph.
This is an indented paragraph in two lines.
This is more indented.

Definition lists

; First title of definition list
: Definition of first item.
; Second title : Second definition
beginning on the same line.
First title of definition list
Definition of first item.
Second title
Second definition beginning on the same line.

Source:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head><title>WikiCreole</title></head><body>
<?php

die(($creole = array(
    
'/[<$ >]|(?<!~)~ /e' => # Zeichen Entwerten
        
'("$0" == "~ ") ? "&nbsp;" : strtr(htmlentities("$0"),array("$" => "&#36;"))',    // '"&#".ord("$0").";"',
    
'/(?:&(?:amp;)?|\?)#(0*(1(2[89]|[3-9]\d)|[2-9]\d\d|\d{4,})|x0*([89a-f][\da-f]|[\da-f]{3,}));/i' => # Beliebige Multicode-Zeichen (80+) ausgeben
        
'&#$1;',
    
'/(~?)(?:\<|&lt;){3}(\w+)\s*(.*?)\s*(?:\>|&gt;){3}/es' => # <<<x>>>
        
'("$1") ? strtr(substr(@"$0",1),array("&lt;" => "&#60;")) : ((isset($creoleph["$2"])) ? ((is_string($creoleph["$2"]))
        ? ((is_callable($creoleph["$2"])) ? $creoleph["$2"](@"$3") : $creoleph["$2"])
        : preg_replace(array_keys($creoleph["$2"]),array_values($creoleph["$2"]),@"$3")) : (("$2" == "_") ? "" : @"$3"))'
,
    
'/\{\{\{\s*((?:[^{}]++|\{(?1)\})*|.*?)\s*\}\}\}/es' => # {{{ Vorformatiert }}}
        
'"<pre>".preg_replace(array("/(?<=&)([gl])t(?=;)/e",
        "/\\\\\\\\\\\'|(&#?\w+;)|(?![\x80-\xff])[[:punct:]]|(?<=[a-z\d])[A-Z]/e","/\r?\n/"),array("((\"\\$1\" == \"l\") ? \"#60\"
        : \"#62\")","((\"\\$1\") ? \"\\$1\" : \"&#\".ord(substr(\"\\$0\",-1)).\";\")","<br />"),"$1")."</pre>\r"'
,
    
# -> Hier kommen die Smilies & Forum-Erweiterungen hin!
    
'/\[(\w+)[^\s\]]*\].*?\[\/\1\]/es' => # [bbcode=option]text[/bbcode]
        
'(($x = "$0") ? eval(\'while(preg_match(\\\'/\[(\w+)(?:=([^\s\]]+))?\](.*?)\[\/\\\\1\]/s\\\',$x,$y,PREG_OFFSET_CAPTURE)) {
        $y = array($y[0],strtolower($y[1][0]),$y[2][0],$y[3][0]); if(preg_match("/^([ibus]|center)$/",$y[1])) {
        $z = array("b"=>"strong", "i"=>"em", "u"=>"ins", "s"=>"del", "center"=>"center"); $z = "<{$z[$y[1]]}>$y[3]</{$z[$y[1]]}>"; }
        elseif($y[1] == "list" and preg_match("/^[1ia]?$/i",$y[2]) and strstr($y[3],"[*]")) $z = strtr(($y[2] == "")
        ? "<ul>$y[3]</li></ul>" : (($y[2] == 1) ? "<ol>$y[3]</li></ol>" : "<ol type=\"$y[2]\">$y[3]</li></ol>"),array("[*]" => "<li>"));
        elseif(preg_match("/left|right/",$y[1])) $z = "<div align=\"$y[1]\">$y[3]</div>";
        elseif(preg_match("/^(font|color|size)$/",$y[1]) and preg_match("/^[\w#-]+$/",$y[2])) $z = "<font ".(($y[1] == "font")
        ? "face" : $y[1])."=\"$y[2]\">$y[3]</font>"; elseif($y[1] == "code") $z = "<pre>"
        .preg_replace("/(?![&#;<>=\"\/])[[:punct:]]/e","\"&#\".ord(\"\\$0\").\";\"",$y[3])."</pre>"; elseif($y[1] == "img")
        $z = "<img src=\"$y[3]\" alt=\"".basename($y[3])."\" border=\"0\">"; elseif(preg_match("/^(link|url)$/",$y[1]))
        $z = "<a href=\"".(($y[2] != "") ? $y[2] : $y[3])."\" target=\"_blank\" rel=\"nofollow\">$y[3]</a>"; elseif($y[1] == "email")
        $z = "<a href=\"mailto:".rawurlencode(($y[2] != "") ? $y[2] : $y[3])."\">".preg_replace("/(?![&#;<>=\"\/])[[:punct:]]/e","\"&#\"
        .ord(\"\\$0\").\";\"",$y[3])."</a>"; elseif($y[1] == "quote") $z = "<blockquote>".(($y[2] != "") ? "<address>$y[2]</address>"
        : "")."$y[3]</blockquote>"; elseif($y[1] == "audio" and preg_match("/^(aac|mp[ag1-4]|m4a|og[ga]|wav|pcm)(;js)?$/",$y[2],$z))
        $z = preg_replace(((isset($z[2])) ? "/^(.*)$/es" : "/^$/"), "\"<script type=\x27text/javascript\x27>document.write(\x27\"
        .strtr(\"\$1\",array(\"/\" => \"\/\")).\"\x27);</script>\"","<audio autobuffer controls><source src=\"$y[3]\" type=\"audio/"
        .preg_replace(array("/mp[123ag]/","/m4a/","/og[ga]/"),array("mpeg","mp4","ogg"),$z[1])."\" />$y[3]</audio>");
        elseif($y[1] == "video" and preg_match("/^(youtube|dailymotion|(mp4|ogg))(?:;(\d+)x(\d+))?(?:;(js|left|right))?$/",$y[2],$z)
        and (preg_match("/^\w+$/",$y[3]) or $z[2])) $z = ($z[2]) ? preg_replace(((isset($z[5])) ? "/^(.*)$/es" : "/^$/"),
        "\"<script type=\x27text/javascript\x27>document.write(\x27\".strtr(\"\$1\",array(\"/\" => \"\/\")).\"\x27);</script>\"",
        "<video src=\"$y[3]\" type=\"video/".substr($z[2],-3)."\"".((isset($z[3])) ? " width=\"$z[3]\"" : "").((isset($z[4]))
        ? " height=\"$z[4]\"" : "").((preg_match("/#(.*)$/",$y[3],$z)) ? " poster=\"$z[1]\" preload=\"none\"" : "")
        ." autobuffer controls>$x[2]</video>") : "<iframe src=\"http://www.".strtr(strtr($z[1],array(
        "youtube" => "youtube.com/embed/#", "dailymotion" => "dailymotion.com/embed/video/#")), array("#" => $y[3]))."\" width=\""
        .((isset($z[3])) ? $z[3] : 640)."\" height=\"".((isset($z[4])) ? $z[4] : 480)."\"".((isset($z[5]) and $z[5] != "js")
        ? " align=\"$z[5]\"" : "")." frameborder=\"0\"></iframe>"; else $z = $y[3];
        $x = substr($x,0,$y[0][1]).$z.substr($x,$y[0][1] + strlen($y[0][0])); } return $x; \') : 0)'
,
    
'/\[\[\[((?:[^\[\]]++|\[(?1)\])*|.*?)\]\]\]/es' => # [[[ Pre-Linebreaks ]]]
        
'preg_replace(array("/\\\\\\\\\\\\\\\\\r?\n/","/\r?\n/","/~([^~])/e"),array("","<br />","\"&#\".ord(\"\$1\").\";\""),"$1")',
    
'/(?<=^|\s)\/\*\s.*?\*\/(?=\s|$)|(?<!^|~)~\r?\n/sm' => # /* Kommentar */
        
'',
    
'/^([ \t]+(?![ \t]+$).+?)$/em' => #  Vorformatiert
        
'"<pre>".preg_replace(array("/\\\\\\\\x5c+(?=[\'\"])/","/~(&#?\w+;|[^~])/e"),array("","\"&#\"
        .ord(html_entity_decode(\"\\$1\")).\";\""),"$1")."</pre> "'
,
    
'/\?\?\s*(\w+)(?:\s*([:=])\s*(.+?))?\s*\?\?/e' => /* ??key=val?? / ??key?? */ 'eval(\'
        return ($x = "$1" and $y = preg_replace("/\?(\w+)\??/e","((isset(\\\\$creolevar[\"_\$1\"])) ? \\\\$creolevar[\"_\$1\"]
        : \"\$0\")","$3")) ? (($creolevar["_$x"] = $y and "$2" == "=") ? "" : $y) : ((isset($creolevar["_$x"])) ? $creolevar["_$x"]
        : "");\')'
,
    
'/(?<=^|[\r\n])(~?)((={1,6})=*(&(?:[gl]t|#6[02]);|[<^>]?)\s*(?:%(\w+)%)?\s*(.+?)[\s=]*?(\[\[#\w+\]\]|#)?(?:\r?\n|$))/e' => # =Titel=    [[#anker]]
        
'("$1") ? "$2" : ($x = (("$7" == "#") ? "[[#".preg_replace(array("/[^a-z\d]+/i","/^(?=\d+)/"),array("","al"),"$6")."]]"
        : "$7"))."<h".strlen("$3").(("$4") ? preg_replace(array("/<|&(lt|#60);/","/\^/","/&(gt|#62);|>/"),
        array("left","center","right")," align=\"$4\"")    : "").(("$5") ? " class=\"$5\"" : "").">"
        .($y = preg_replace("/(<.*?>)|(?![~&#;])([!-\/:-@\[-`\{-~])/es","(\"\\$1\") ? \"\\$1\" : \"&#\".ord(\"\\$2\").\";\"","$6"))
        ."</h".strlen("$3").">\r".(("$7" and $creolevar[".al"][substr($x,3,-2)] = $y) ? "" : "")'
,
    
'/(?<!@)@@(.*?)@@(?!@)/es' => # @@Fest@@
        
'"<code>".preg_replace(array("/\\\\\\\\x5c+(?=[\'\"])/","/~(&#?\w+;|[^~])/e"),
        array("","\"&#\".ord(html_entity_decode(\"\\$1\")).\";\""),"$1")."</code> "'
,
    
'/(?<![!-])--([^\r\n]+?)--(?!-)/' => # --Klein--
        
'<small>$1</small>',
    
'/(?<!~)~~(.+?)~~(?!~)/' => # ~~Durchgestrichen~~
        
'<del>$1</del>',
    
'/(?<!_)__(.+?)__(?!_)/' => # __Unterstrichen__
        
'<ins>$1</ins>',
    
'/(?<!#)##(?!\s)(.+?)(?<!\s)##(?!#)/' => # ##Druck##
        
'<tt>$1</tt>',
    
'/(?<!\^)\^\^(.+?)\^\^(?!\^)/' => # ^^Hoch^^
        
'<sup>$1</sup>',
    
'/(?<!,),,(.+?),,(?!,)/' => # ,,Tief,,
        
'<sub>$1</sub>',
    
'/\*\*(?!\s)((?:[^\n]*?(?<!\*)|(?<![\r\n]|\*\*)\r?\n(?!\r?\n|\*\*)){1,3})(?<!\s)\*\*/' => # **Fett**
        
'<strong>$1</strong>',
    
'/(?<!\{)\{\{(?!\{)\s*(&(?:[gl]t|#6[02]);|[<>]?)\s*([+-]?)\s*(?:%(\w+)%\s*)?(:|;|https?:|\/)?([^#|}<>]+)(?:#(\d+)[x*.-](\d+)|[^|}]*?)?\s*(?:\|\s*([^|}]*)(?:\|([^}]+))?)?\s*(?<!\})\}\}(?!\})/e' => # {{<>+-%class%Bild#width-height|Note|style}}
        
'preg_replace("/&(?!#?\w+;)/","&amp;","<img ".(("$2") ? "class=\"$3\"" : "")."src=\"".(("$4" == ":") ? "http://" : (("$4" == ";") ? "https://" : "$4"))
        .preg_replace("/[\s\x80-\xff]+/e","urlencode(\"\$0\")","$5")."\"".(("$6" and "$7") ? " width=\"$6\" height=\"$7\"" : "")
        ." alt=\"$8\" title=\"$8\" border=\"".(("$2" == "+") ? 1 : 0)."\"".(("$9") ? " style=\"$9\"" : "")
        .(("$1") ? preg_replace(array("/<|&(lt|#60);/","/&(gt|#62);|>/"),array("left","right")," align=\"$1\"") : "")." />")'
,
    
'/(~|[&\#\w;]+(?<!-)-?)?\[\[\s*(\^|%\w+%\s*)?(?:([^\]]+)\s*-(?:\>|&gt;|&\#62;)\s*)?(~?\(?(?:https?|ftp|mailto)?:|;|~?[\/\#])?([^|\]]+?)(?:\^([^|\]]+)\^)?(?:\s*\|\s*([^\]]+))?\s*\]\]((?:-?(?!-)[&\#\w;]+)+)?/e' => # pre[[%class%Link_~(url~)(?Versteckt)^Title^]]end / [[%class%Link^Title^|Text]] / [[%class% Text -> Link^Title^]]
        
'("$1" == "~") ? substr(@"$0",1) : "<a ".(("$2") ? "class=\"".(("$2" == "^") ? "home" : preg_replace("/\W+/","","$2"))."\" " : "")
        .((preg_match("/^~?(http|:|;)/","$4")) ? "target=\"_blank\" rel=\"nofollow\" " : "").(("$6" != "") ? "title=\"$6\" "
        : "").preg_replace("/&(?!#?\w+;)/","&amp;",((substr("$4",0,1) == "#" && "$3$7" == "") ? "name=\"$5\">$1$8"
        : (("$2" == "" and substr("$4",0,1) == "#") ? "class=\"anchor\" " : "")."href=\"".((substr("$4",0,1) == "~")
        ? (($x = preg_replace("/!!(.*?)!!/e","rawurlencode(\"\$1\")",substr("$4",1)."$5") and "$1$3$7$8") ? "$x\">$1$3$7$8"
        : "$x\">$x"): preg_replace(array("/(?:[\\\\\\\\x5c~]([(+~)])|([\s\x80-\xff]+))/e","/&(?!amp;)#?x?\w+;/e","/[()]/"),
        array("rawurlencode(\"\$1\$2\")","urlencode(html_entity_decode(\"\$0\",ENT_QUOTES))",""),(("$2$4" == "^")
        ? "$_SERVER[SCRIPT_NAME]/" : (("$4" == ":") ? "http://" : (("$4" == ";") ? "https://" : "$4")))."$5")."\"".">"
        .((($x = (("$3$7" && "$3$7" != "+") ? "$1$3$7$8" : "$1"
        .preg_replace("/(^(?=[^(]*\))|(?<![\\\\\\\\x5c~])\().+?((?<![\\\\\\\\x5c~])\)|$)|[\\\\\\\\x5c~](?![\\\\\\\\x5c~])|^[:;]/",
        "","$4$5")."$8")) && "$3$7" == "+") ? preg_replace(array("/%[\da-f]{2}/ei",
        "/[_+]|(?<=[[:lower:]\d])(?=[[:upper:]])|(?<=[^-\d])(?=\d[-\d]*( |$))|(?<=[[:upper:]])(?=[[:upper:]][[:lower:]\d])/u"),
        array("urldecode(\'\$0\')"," "),$x) : $x)))."</a>")'
,
    
'/(?<![\w\/+])\+\+(.+?)\+\+(?![\w\/+])/' => # ++Groß++
        
'<big>$1</big>',
    
'/(?<!http:|https:|ftp:|[\w\/+])\/\/(?!\s)((?:[^\n]+?|(?<![\r\n]|\/\/)\r?\n(?!\r?\n|\/\/)){1,3})(?<!http:|https:|ftp:|\s)\/\/(?![\w\/+])/' => # //Kursiv//
        
'<em>$1</em>',
    
'/(?:^|(?<=[\r\n]))(~?)((?:[;:>]|&gt;)(?:.*\r?\n(?=(?:[;:>\w]|&gt;))|.*)+)/e' => /* # Definitionen */
        
'(@$x = strtr("$2",array("\\\'" => "\'"))) ? eval(\'if(!"$1"
        and preg_match_all("/(?<=^|\s|\W)([;:]+)\s*((?:.*?(?=[\s\W][;:]|$)|(?<=\w)[;:])+)[ \t]*/s",
        preg_replace(array("/(?<=^|\n)(&gt;|>)+/e","/&(?!#?\w)/"),array("str_replace(array(\"&gt;\",\">\"),\":\",\"\$0\")","&amp;"),
        $x),$ay)) { $x = ""; $z = 0; foreach($ay[2] as $k => $v) { $w = strlen($ay[1][$k]) - $z;
        $y = (substr($ay[1][$k],0,1) == ";") ? "t" : "d"; if($w > 0) { $u = 1; while($u++ < $w) { $x .= "<dd><dl>"; $z++; }}
        elseif($w < 1) while($w++ < 1) { $x .= "</dl></dd>"; $z--; } $x .= "<d$y>".trim($v)."</d$y>"; } while($z--)
        $x .= "</dl></dd>"; $x = "<dl>$x</dl>"; } return $x; \') : 0'
,
    
'/(?:^|(?<=[\r\n]))(~?)((?:\*|#)+(?![*#\r\n]).+?)(?=\r?\n(?![*#])|$)[ \t]*(?![*#])/es' => /* # Auflistung */
        
'(@$x = strtr("$2",array("\\\'" => "\'"))) ? eval(\'if(!"$1" and
        preg_match_all("/^(\*+|#+)(?:([acdins])?(\d+)?(?<=\w)[*#])?\s*(.*?)\s*$/mi",preg_replace("/&(?!#?\w)/","&amp;",$x),$ay)) {
        $x = ""; $z = array(); foreach($ay[4] as $k => $v) { $w = strlen($ay[1][$k]) - count($z);
        $y = (substr($ay[1][$k],0,1) == "*") ? "u" : "o"; if($w > 0) { $u = 1; while($u++ < $w) { $x .= "<dl><dd>"; $z[] = "dl"; }
        $x .= "<{$y}l".(($ay[2][$k]) ? " type=\"".strtr($ay[2][$k], array("d" => "disc", "c" => "circle", "s" => "square",
        "n" => "none"))."\"" : "").">"; $z[] = $y."l"; } elseif($w < 0) while($w++ < 0) $x .= (($u = array_pop($z)) == "dl")
        ? "</dd></dl>" : "</li></$u>"; if(end($z) != $y."l") { $x .= (($u = array_pop($z)) == "dl") ? "</dd></dl><{$y}l>"
        : "</li></$u><{$y}l>"; $z[] = $y."l"; } $x .= "<li".(($ay[3][$k]) ? " value=\"{$ay[3][$k]}\"" : "").">$v"; }
        while($u = array_pop($z)) $x .= ($u == "dl") ? "</dd></dl>" : "</li></$u>\r"; } return $x; \') : 0'
,
    
'/(?<=^|[\r\n])(~?)(\|.*?)(?=\n(?!\|)|$)[ \t]*(?!\|)/es' => /* | Tabelle | */ '(@$x = strtr("$2",array("\\\'" => "\'"))) ? eval(\'
        if(!"$1" and preg_match_all("/^\|(.*?)\|?\s*$/m",preg_replace(array("/^\|[^=|\n]*\r?\n/","/&(?!#?\w)/"),
        array("","&amp;"),$x),$ay)) { foreach($ay[1] as $k => $v) { $ay[0][$k] = preg_split("/(?<!~)\|/",$v);
        $ay[2][] = count($ay[0][$k]); $x = -1; foreach($ay[0][$k] as $u => $w) if($w != "") $x = $u; elseif($x >= 0 && $w == "") {
        $ay[3][$k][$x] = (isset($ay[3][$k][$x])) ? $ay[3][$k][$x] + 1 : 1; unset($ay[0][$k][$u]); }}
        if(count(array_unique($ay[2])) > 1 and $u = min($ay[2])) foreach($ay[0] as $k => $x) $ay[0][$k] = array_slice($x,0,$u);
        foreach($ay[0] as $k => $trow) { $ay[1][$k] = "<tr>"; foreach($trow as $x => $tcell)
        if(preg_match("/^(=?)([ \t]*)(.*?)([ \t]*)$/",$tcell,$v)) $ay[1][$k] .= "<t".(($v[1] != "") ? "h" : "d").((isset($ay[3][$k][$x]))
        ? " colspan=\"".($ay[3][$k][$x]+1)."\"" : "").(($v[2] != "" && $v[4] != "") ? " align=\"center\""
        : (($v[2] != "" && $v[4] == "") ? " align=\"right\"" : (($v[2] == "" && $v[4] != "") ? " align=\"left\"" : ""))).">"
        .preg_replace(array("/~\|/","/^_$/","/(?<!~)~-/"),array("|","&nbsp;","<br />"),$v[3])."</t".(($v[1] != "") ? "h" : "d").">";
        $ay[1][$k] .= "</tr>"; } if(preg_match("/^\|\s*(&(?:[gl]t|#6[02]);|[<^>]?)\s*([-+])?\s*(?:%(\w+)%)?\s*(\d+%?)?\s*$/m","$2",
        $v)) $v[1] = ((isset($v[1]) and $v[1]) ? preg_replace(array("/<|&(lt|#60);/","/\^/","/&(gt|#62);|>/"),
        array("left","center","right")," align=\"$v[1]\"") : ""); return "<table ".((isset($v[3]) and $v[3]) ? "class=\"$v[3]\" "
        : "")."border=\"".((isset($v[2]) and $v[2] == "-") ? 0 : 1)."\"".((isset($v[1])) ? $v[1] : "").((isset($v[4]) and $v[4])
        ? " width=\"$v[4]\"" : "").">".implode("",$ay[1])."</table>"; } return $x; \') : 0'
,
    
'/(~?)(?<!<|&lt;)((?:\<|&lt;){2}(\w+)\s*(.*?)\s*(?:\>|&gt;){2})/e' => /* <<function ...>> */
        
'(@$x = array("$3",strtr("$4",array("\\\'" => "\'"))) and !"$1" and
        preg_match_all("/(?:(\w+)=)?(?:(\'|&(?:amp;)?(?:#34|#39|quot);)(.*?)(?<!\\\\\x5c|&#92;)\\\\\\\2|(\S+))|(\S+)|^$/",$x[1],$y)
        and ((isset($creolepi[$x[0]]) and $x[2] = $creolepi[$x[0]] or 1) and !eval(\'while($z = each($y[3])) $y[(($y[1][$z[0]])) ? 6
        : 7][$z[0]] = ($z[1]) ? $z[1] : $y[4][$z[0]]; if(isset($x[2]) and isset($x[2][1])) { $x[3] = (is_array($x[2])) ? $x[2][0]
        : $x[2]; if(is_array($x[2][1])) { $x[4] = array_flip($y[1]); foreach($x[2][1] as $z) { if(isset($x[4][$z])) {
        $x[5][$z] = $y[6][$x[4][$z]]; unset($y[6][$x[4][$z]]); } elseif(preg_match("/^(\w+)\?$/",$z,$y[8])) { $z = $y[8][1];
        if(isset($x[4][$z])) { $x[5][$z] = $y[6][$x[4][$z]]; unset($y[6][$x[4][$z]]); } elseif($y[8] = each($y[7])) {
        $x[5][$z] = $y[8][1]; unset($y[7][$y[8][0]]); }} elseif($y[8] = each($y[7])) { $x[5][$z] = $y[8][1];
        unset($y[7][$y[8][0]]); } else { unset($x[5]); $x[2][1] = count($x[2][1]); break; }}} if(is_int($x[2][1]) and $x[2][1]
        and count($y[0]) >= $x[2][1]) for($z=0;$z<$x[2][1];$z++) $x[5][$z] = (isset($y[6][$z])) ? $y[6][$z] : $y[7][$z]; }
        if(isset($x[2][1]) and is_int($x[2][1]) and !$x[2][1] and count($y[0]) or !isset($x[2])) { for($z=0;$z<count($y[0]);$z++)
        $x[5][$z] = ($y[3][$z]) ? $y[3][$z] : $y[4][$z]; $x[5] = array(implode(" ",$x[5])); } $z = (isset($x[5])) ? $x[5]
        : ((isset($y[6])) ? $y[6] : false);\'))) ? eval(((isset($x[3]) and preg_match("/^\w+$/",$x[3]) and function_exists($x[3]))
        ? \'return ($z) ? @call_user_func_array($x[3],array_values($z)) : @$x[2]();\' : ((isset($x[3]) and preg_match("/[(\s;)]/",
        $x[3]) and ((is_string($x[2])) or isset($x[5]))) ? $x[3] : \'return $z[0];\'))) : ""'
,
    
'/([~^]?)(?<=^|[\s~^]|[^\'"]>)((?:(?:s?ftp|https?):\/\/|(www\.))(?:[\w.-]+(?::[^\s@]+)@)?[\w.:\[\]-]+[\/?#]?(?:[\w.\/:_?=&;#%+-]*?(\.(?:bmp|bpg|gif|ico|jpe?g|jp?2k?|png|svg))|[\w.\/:_?=&;#%+-]*)|(?<=^|[~|^\s]|\\\\)((?:(?:[A-Z]+[a-z\d]+){2,8}|(?<=\^)\w+)(?:#\w+)?)(?=\\\\|[\s,.!?~|]|$)|(?<!mailto:|["<\w])(\w[\w._\/-]*@[\w.-]+\.\w+))(?![^<]+<\/a>)/e' => # http://link / www.pic.jpg / mail@to.me / WikiLink
        
'("$1"=="~") ? strtr("$2",array(":"=>"&#58;","@"=>"&#64;")) : preg_replace("/&(?!amp;)/","&amp;",(("$4") ? "<img src=\""
        .(("$3") ? "http://" : "")."$2\" alt=\"$2\" />" : "<a href=\"".(("$5") ? "$_SERVER[SCRIPT_NAME]/$2\" class=\"home\""
        : (("$3") ? "http://" : (("$6") ? "mailto:" : ""))."$2\" rel=\"nofollow\" target=\"_blank\"").">$2</a>"))'
,
    
'/\\\\u(?:\{(?=\w+\}))?([\da-f]+)\}?/ie' => # \u1234
        
'eval(\'if(($x = hexdec("$1")) < 128) return chr($x); $y = ""; $z = 6; while($x >= 1 << $z and --$z) { $y = chr($x % 64 | 128).$y; $x = $x / 64 | 0; }
        return chr((1 << 7 - $z) -1 << ++$z | $x).$y; \')'
,
    
'/(?<=^|\n)----\r?\n?/' => "<hr />\r",
    
'/(~)?(\\\\{2})/e' => "('$1') ? '$2' : '<br />\r'",
    
'/\\\\\r?\n/' => "",
    
'/[\r\n]+--([\r\n]+|$)/' => "<br clear='all' />\r",
    
'/(\r?\n){3,}/' => "\r\n\r\n",
    
'/(\r?\n){2}/' => "<p><!----></p>\r",
)) ? 
preg_replace(array_keys($creole),array_values($creole),strtr(<<<eof
|>
|??wc=http://www.wikicreole.org/wiki/????rf=reference??[[[\\
- [[#)BoldAndItalics|+]]
- [[#)Headings|+]]
- [[#)Links|+]]
- [[#)Paragraphs|+]]
- [[#)LineBreaks|+]]
- [[#)Lists|+]]
- [[#)HorizontalLine|+]]
- [[#)Images|+]]
- [[#)Tables|+]]
- [[#)PreformattedAndNowiki|+]]
- [[#)Escape|+]]
- [[#)Placeholder|+]]
- [[#)CreoleAdditions|+]]
]]]|
=^Creole Test[[#Test]]
Dieser Text wird als **[[http://www.)WikiCreole(.org|+]]** angezeigt und ist mit Hilfe von [[http://de.wikipedia.org/wiki/)PHP]] und [[https://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck|Regulären Ausdrücken]] quasi ein //Einzeiler//!
--
|>-
|[ [[??wc??BoldAndItalics|??rf??]] ]
==Bold And Italics#
===Bold
|>
|{{{**bold**}}}|
**bold**
--
===Italics
|>
|{{{//italics// }}}|
//italics// 
--
===Bold Italics
|>
|{{{Bold and italics should //be
able// to cross lines.

But, should //not be...

...able// to cross paragraphs.}}}|
Bold and italics should //be
able// to cross lines.

But, should //not be...

...able// to cross paragraphs.
--
|>
|{{{//**bold italics**//
**//bold italics//**
//This is **also** good.//}}}|
//**bold italics**//
**//bold italics//**
//This is **also** good.//
--
/* ====Unacceptable
|>
|{{{**//bold italics**//
//**bold italics//**}}}|
**//bold italics**//
//**bold italics//**
-- */
===Bold and/or italic links
|>
|{{{//[[Important page|this link is italic]]//
**[[Important page]]**
//**[[Important page]]**//}}}|
//[[Important page|this link is italic]]//
**[[Important page]]**
//**[[Important page]]**//
--
===Bold, Italics, Links, Pre in Lists
|>
|{{{* **bold** item
* //italic// item
# item about a [[certain page]]
# {{{ //this// is **not** [[processed]] }}}}}}|
* **bold** item
* //italic// item
# item about a [[certain page]]
# {{{ //this// is **not** [[processed]] }}}
--
----
|>-
|[ [[??wc??Headings|??rf??]] ]
==Headings#
|>
|{{{= Level 1 (largest) =
== Level 2 ==
=== Level 3 ===
==== Level 4 ====
===== Level 5 =====
====== Level 6 ======}}}|
= Level 1 (largest) =
== Level 2 ==
=== Level 3 ===
==== Level 4 ====
===== Level 5 =====
====== Level 6 ======
--
|>
|{{{=== Also level 3
=== Also level 3 =
=== Also level 3 ==
=== **not** //parsed// ===}}}|
=== Also level 3
=== Also level 3 =
=== Also level 3 ==
=== **not** //parsed// ===
--
====Unacceptable
|>
|{{{== Heading with [[link]]
== Heading with **bold** or //italics//
== Heading with {{Image:image|image}}
== Heading with <<<6>>> placeholder}}}|
== Heading with [[link]]
== Heading with **bold** or //italics//
== Heading with {{Image:image|image}}
== Heading with <<<6>>> placeholder
--
----
|>-
|[ [[??wc??Links|??rf??]] ]
==Links#
|>
|{{{[[link]]
[[MyBigPage|Go to my page]]
[[http://www.wikicreole.org/]]
http://www.rawlink.org/, http://www.another.rawlink.org
[[http://www.wikicreole.org/|Visit the WikiCreole website]]
[[Weird Stuff|**Weird** //Stuff//]]
[[Ohana:WikiFamily]]}}}|
[[link]]
[[MyBigPage|Go to my page]]
[[http://www.wikicreole.org/]]
http://www.rawlink.org/, http://www.another.rawlink.org
[[http://www.wikicreole.org/|Visit the WikiCreole website]]
[[Weird Stuff|**Weird** //Stuff//]]
[[Ohana:WikiFamily]]
--
----
|>-
|[ [[??wc??Paragraphs|??rf??]] ]
==Paragraphs#
|>
|{{{This is my text.

This is more text.
}}}|
This is my text.

This is more text.
--
----
|>-
|[ [[??wc??LineBreaks|??rf??]] ]
==Line Breaks#
|>
|{{{This is the first line,\\\\and this is the second.}}}|
This is the first line,\\\\and this is the second.
--
----
|>-
|[ [[??wc??Lists|??rf??]] ]
==Lists#
===Unordered Lists
|>
|{{{* Item 1
* Item 2
}}}|
* Item 1
* Item 2
--
===Ordered Lists
|>
|{{{# Item 1
# Item 2}}}|
# Item 1
# Item 2
--
===Nesting
|>
|{{{* Item 1
* Item 2
** Item 2.1
** Item 2.2}}}|
* Item 1
* Item 2
** Item 2.1
** Item 2.2
--
===Mixing
|>
|{{{* Item 1
* Item 2
## Item 2.1
## Item 2.2}}}|
* Item 1
* Item 2
## Item 2.1
## Item 2.2
--
===Leading Whitespace
|>
|{{{* Item 1
* Item 2
**  Item 2.1
** Item 2.2
}}}|
* Item 1
* Item 2
**  Item 2.1
** Item 2.2
--
----
|>-
|[ [[??wc??HorizontalLine|??rf??]] ]
==Horizontal Line#
|>
|{{{----}}}|
----
--
----
|>-
|[ [[??wc??Images|??rf??]] ]
==Images#
|>
|{{{{{myimage.jpg}}}}}
{{myimage.jpg}}
--
|>
|{{{{{myimage.jpg|this is the alt text for my image}}}}}
{{myimage.jpg|this is the alt text for my image}}
--
|>
|{{{[[some link|{{myimage.jpg}}]] - if you click on the image, will goto "some link"}}}
[[some link|{{myimage.jpg}}]] - if you click on the image, will goto "some link"
--
|>
|{{{[[http://example.com/|{{myimage.jpg}}]] - same as above: picture links to url}}}
[[http://example.com/|{{myimage.jpg}}]] - same as above: picture links to url
--
----
|>-
|[ [[??wc??Tables|??rf??]] ]
==Tables#
|>
|{{{|=Heading Col 1 |=Heading Col 2         |
|Cell 1.1       |Two lines\\\\in Cell 1.2 |
|Cell 2.1       |Cell 2.2               |}}}|

|=Heading Col 1 |=Heading Col 2         |
|Cell 1.1       |Two lines\\\\in Cell 1.2 |
|Cell 2.1       |Cell 2.2               |
--
===Simple table
|>
|{{{|Cell 1.1       |Cell 1.2
|Cell 2.1       |Cell 2.2}}}|

|Cell 1.1       |Cell 1.2
|Cell 2.1       |Cell 2.2
--
===Table rows ending with | are optional.
|>
|{{{|Cell 1.1 | Cell 1.2 |
|Cell 2.1 | Cell 2.2 |}}}|

|Cell 1.1 | Cell 1.2 |
|Cell 2.1 | Cell 2.2 |
--
===Table with heading
|>
|{{{|=Heading Col 1 |=Heading Col 2
|Cell 1.1       |Cell 1.2
|Cell 2.1       |Cell 2.2}}}|

|=Heading Col 1 |=Heading Col 2
|Cell 1.1       |Cell 1.2
|Cell 2.1       |Cell 2.2
--
===Table with forced line break using the \\\\ syntax
|>
|{{{|=Heading Col 1                         |= Heading Col 2
|Cell 1.1 line one \\\\ Cell 1.1 line two | Cell 1.2}}}|

|=Heading Col 1                         |= Heading Col 2
|Cell 1.1 line one \\\\ Cell 1.1 line two | Cell 1.2
--
----
|>-
|[ [[??wc??PreformattedAndNowiki|??rf??]] ]
==Preformatted And Nowiki#
|>
|{{{{{{
//This// does **not** get [[formatted]] 
}}}}}}|
{{{
//This// does **not** get [[formatted]] 
}}}
--
|>
|{{{Some examples of markup are: {{{** <i>this</i> ** }}}}}}|
Some examples of markup are: {{{** <i>this</i> ** }}}
--
===Closing braces in nowiki
|>
|{{{{{{
{{if (a>b) { b = a; }}}
}}}}}}|
{{{
{{if (a>b) { b = a; }}}
}}}
--
|>
|{{{{{{
if (x != NULL) {
  for (i = 0; i < size; i++) {
    if (x[i] > 0) {
      x[i]--;
  }}}
}}}}}}|
{{{
if (x != NULL) {
  for (i = 0; i < size; i++) {
    if (x[i] > 0) {
      x[i]--;
  }}}
}}}
--
----
|>-
|[ [[??wc??Escape|??rf??]] ]
==Escape#
|>
|{{{~#1
http://www.foo.com/~bar/
~http://www.foo.com/
CamelCaseLink
~CamelCaseLink}}}|
~#1
http://www.foo.com/~bar/
~http://www.foo.com/
CamelCaseLink
~CamelCaseLink
--
----
|>-
|[ [[??wc??Placeholder|??rf??]] ]
==Placeholder#
|>
|{{{<<<x>>>}}}|
<<<x>>>
--
----
|>-
|[ [[??wc??CreoleAdditions|??rf??]] ]
==Creole Additions#
===Plug-in/Extension
|>
|{{{<<CurrentTimePlugin format='yyyy.MM.dd'>>}}}|
<<CurrentTimePlugin format='yyyy.MM.dd'>>
--
===Monospace
|>
|{{{This is ##monospace## text.}}}|
This is ##monospace## text.
--
===Superscript
|>
|{{{This is ^^superscripted^^ text.}}}|
This is ^^superscripted^^ text.
--
===Subscript
|>
|{{{This is ,,subscripted,, text.}}}|
This is ,,subscripted,, text.
--
===Underline
|>
|{{{This is __underlined__ text.}}}|
This is __underlined__ text.
--
===Alternate Link Syntax
|>
|{{{[[description -> link]]
[[the -> can be used to make a link -> TextFormattingRules]]}}}|
[[description -> link]]
[[the -> can be used to make a link -> TextFormattingRules]]
--
===Indented paragraphs
|>
|{{{This is a normal paragraph.
:This is an indented
paragraph in two lines.
::This is more indented.}}}|
This is a normal paragraph.
:This is an indented
paragraph in two lines.
::This is more indented.
--
|>
|{{{This is a normal paragraph.
>This is an indented
paragraph in two lines.
>>This is more indented.}}}|
This is a normal paragraph.
>This is an indented
paragraph in two lines.
>>This is more indented.
--
===Definition lists
|>
|{{{; First title of definition list
: Definition of first item.
; Second title : Second definition
beginning on the same line.}}}|
; First title of definition list
: Definition of first item.
; Second title : Second definition
beginning on the same line.
eof
,array(
"\'" => "'"))).'<hr><a name="Source" /><h3>Source:</h3>'.show_source(__FILE__,true).'<hr><div align="right"><address><small>&copy; '
.date("d.m.Y",filemtime(__FILE__)).' by <a href="http://www.mengelke.de">Michael Engelke</a></small></address></div>' '');

?>
</body></html>

© 10.11.2019 by Michael Engelke