diff --git a/README.md b/README.md index 507c5a7..150bc56 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,10 @@ It's basically an attempt to recreate [wiky.js](https://github.com/tanin47/wiky. // If you pass true to __construct (new wiky(true)), "S" PCRE modifier will be added to all regular expressions. This gives a performance boost when running parse thousands of times. Extreme usage only. $wiky=new wiky; - // Call for the function parse() on the variable You created and pass some unparsed text to it, it will return parsed HTML or false if the content was empty. In this example we are loading the file input.wiki and passing it's contents - echo $wiky->parse(file_get_contents("input.wiki")); + // Call for the function parse() on the variable You created and pass some unparsed text to it, it will return parsed HTML or false if the content was empty. In this example we are loading the file input.wiki, escaping all html characters with htmlspecialchars and running parse and echoing the output + $input=file_get_contents("input.wiki"); + $input=htmlspecialchars($input); + echo $wiky->parse($input); ## Author Toni Lähdekorpi diff --git a/howto.php b/howto.php index 1989833..ba80f19 100644 --- a/howto.php +++ b/howto.php @@ -8,5 +8,7 @@ // If you pass true to __construct (new wiky(true)), "S" PCRE modifier will be added to all regular expressions. This gives a performance boost when running parse thousands of times. Extreme usage only. $wiky=new wiky; -// Call for the function parse() on the variable You created and pass some unparsed text to it, it will return parsed HTML or false if the content was empty. In this example we are loading the file input.wiki and passing it's contents -echo $wiky->parse(file_get_contents("input.wiki")); +// Call for the function parse() on the variable You created and pass some unparsed text to it, it will return parsed HTML or false if the content was empty. In this example we are loading the file input.wiki, escaping all html characters with htmlspecialchars and running parse and echoing the output +$input=file_get_contents("input.wiki"); +$input=htmlspecialchars($input); +echo $wiky->parse($input); diff --git a/input.wiki b/input.wiki index c198a0d..73e8dc8 100644 --- a/input.wiki +++ b/input.wiki @@ -25,6 +25,7 @@ This is a bold link: '''[http://www.google.com Google]'''. This is a bold-italic link: '''''[http://www.google.com Google]'''''. This is '''bold''', '''''bold-italic''''', and ''italic'' This here is a link without text [http://lygon.net] +Don't forget to strip out, or convert any html if planning on echoing directly to a page. Some more lines1 :A line with indent