Wiki Creole

Dieser Text wird als Wiki Creole angezeigt und ist mit Hilfe von PHP und Regulären Ausdrücken quasi ein Einzeiler!
- Bold And Italics
- Headings
- Links
- Paragraphs
- Line Breaks
- Lists
- Horizontal Line
- Images
- Tables
- Preformatted And Nowiki
- Escape
- Placeholder
- Creole Additions

Creole Test


[ 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").";"',
    
'/(~?)(?:\<|&lt;){3}(\w+)\s*(.*?)\s*(?:\>|&gt;){3}/es' => # <<<x>>>
        
'("$1") ? strtr(substr(@"$0",1),array("&lt;" => "&#60;")) : ((isset($GLOBALS["creoleph"]["$2"])) ? ((is_string($GLOBALS["creoleph"]["$2"]))
        ? ((is_callable($GLOBALS["creoleph"]["$2"])) ? $GLOBALS["creoleph"]["$2"](@"$3") : $GLOBALS["creoleph"]["$2"])
        : preg_replace(array_keys($GLOBALS["creoleph"]["$2"]),array_values($GLOBALS["creoleph"]["$2"]),@"$3")) : (("$2" == "_") ? "" : @"$3"))'
,
    
'/\{\{\{((?:[^{}]++|\{(?1)\})*|.*?)\}\}\}/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!
    
'/\[\[\[((?:[^\[\]]++|\[(?1)\])*|.*?)\]\]\]/es' => # [[[ Pre-Linebreaks ]]]
        
'preg_replace(array("/\\\\\\\\\\\\\\\\\r?\n/","/\r?\n/","/~([^~])/e"),array("","<br />","\"&#\".ord(\"\$1\").\";\""),"$1")',
    
'/(?<=^|\s)\/\*\s.*?\*\/(?=\s|$)/sm' => # /* Kommentar */
        
'',
    
'/^( +(?! +$).+?)$/em' => #  Vorformatiert
        
'"<pre>".preg_replace("/(?![&#;<>=\"\/])[[:punct:]]/e","\"&#\".ord(\"\\$0\").\";\"","$1")."</pre> "',
    
'/\?\?\s*(\w+)(?:\s*([:=])\s*(.+?))?\s*?\?\?/e' => /* ??key=val?? / ??key?? */ 'eval(\'
        return ($x = "$1" and $y = preg_replace("/\?(\w+)\??/e","((isset(\\\\$GLOBALS[\"_var_\"][\"\$1\"])) ? \\\\$GLOBALS[\"_var_\"][\"\$1\"] : \"\$0\")","$3"))
        ? (($GLOBALS["_var_"][$x] = $y and "$2" == "=") ? "" : $y) : ((isset($GLOBALS["_var_"][$x])) ? $GLOBALS["_var_"][$x] : "");\')'
,
    
'/(?<=^|[\r\n])(~?)((={1,6})=*(&(?:[gl]t|#6[02]);|[<^>]?)\s*(?:%(\w+)%)?\s*(.+?)[\s=]*?(\[\[#\w+\]\]|#)?(?:\r?\n|$))/e' => # =Titel=    [[#anker]]
        
'("$1") ? "$2" : (("$7" == "#") ? "[[#".preg_replace("/\W+/","","$6")."]]" : "$7")."<h".strlen("$3").(("$4")
        ? preg_replace(array("/<|&(lt|#60);/","/\^/","/&(gt|#62);|>/"),array("left","center","right")," align=\"$4\"") : "").(("$5")
        ? " class=\"$5\"" : "").">".preg_replace("/(?![~&#;])[!-\/:-@\[-`\{-~]/e","\"&#\".ord(\"\\$0\").\";\"","$6")."</h".strlen("$3").">\r"'
,
    
'/(?<!@)@@(.*?)@@(?!@)/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".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^]]
        
'"<a ".(("$2") ? "class=\"$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" : "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","/[()]/"),array("rawurlencode(\"\$1\$2\")",""),"$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>:]|\n&gt;)&gt;/","/&(?!#?\w)/"),array(":","&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("/^([*]+|#+)\s*(.*?)\s*$/m",preg_replace("/&(?!#?\w)/","&amp;",$x),$ay)) {
         $x = "";
         $z = array();
         foreach($ay[2] 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>";
           $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>$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)
          return "$1";
         foreach($ay[0] as $k => $trow) {
          $ay[1][$k] = "<tr>";
          foreach($trow as $x => $tcell)
           if(preg_match("/^(=?)(\s*)(.*?)(\s*)$/",$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($GLOBALS["creolepi"][$x[0]]) and $x[2] = $GLOBALS["creolepi"][$x[0]] or 1) and !eval(\'
         while($z = each($y[3]))
          $y[6][$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][] = $y[6][$x[4][$z]];
             unset($y[6][$x[4][$z]]);
            }
            elseif(preg_match("/^(\w+)\?$/",$z,$z)) {
             if(isset($x[4][$z[1]])) {
              $x[5][] = $y[6][$x[4][$z[1]]];
              unset($y[6][$x[4][$z[1]]]);
             }
             elseif($z = each($y[6])) {
              $x[5][] = $z[1];
              unset($y[6][$z[0]]);
             }
            }
            else {
             unset($x[5]);
             $x[2][1] = count($x[2][1]);
             break;
            }
          }
          if(is_int($x[2][1]) and count($y[0]) >= $x[2][1])
           for($z=0;$z<$x[2][1];$z++)
            $x[5][$z] = $y[6][$z];
         }
         $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],$z) : @$x[2]();\'    // Function aufrufen
        : ((isset($x[3]) and preg_match("/[(\s;)]/",$x[3]) and ((is_string($x[2])) or isset($x[5]))) ? $x[3]
        : \'foreach($y[3] as $x => $z)                // Parameter Intelligent ausgeben
          if($z = ($z) ? $z : (($y[4][$x]) ? $y[4][$x] : $y[5][$x]))
           $y[6][$x] = $z;
         return (isset($y[6])) ? implode(" ",$y[6]) : "";\'))) : ""'
,
    
'/([~^]?)((?<![\'"=\w\/@?#.<;]|[\'"]>)(?:(?: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>"))'
,
    
'/(?<=^|\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
=^Wiki Creole
Dieser Text wird als **[[http://www.)WikiCreole(.org|+]]** angezeigt und ist mit Hilfe von [[http://de.wikipedia.org/wiki/)PHP]] und [[http://de.wikipedia.org/wiki/Regulärer_Ausdruck|Regulären Ausdrücken]] quasi ein //Einzeiler//!
|>
|??wc=http://www.wikicreole.org/wiki/????rf=reference??[[[\\
- [[#)BoldAndItalics|+]]
- [[#)Headings|+]]
- [[#)Links|+]]
- [[#)Paragraphs|+]]
- [[#)LineBreaks|+]]
- [[#)Lists|+]]
- [[#)HorizontalLine|+]]
- [[#)Images|+]]
- [[#)Tables|+]]
- [[#)PreformattedAndNowiki|+]]
- [[#)Escape|+]]
- [[#)Placeholder|+]]
- [[#)CreoleAdditions|+]]
]]]|
=^Creole Test[[#Test]]
--
|>-
|[ [[??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>

© 08.02.2015 by Michael Engelke