Skip to content

Commit

Permalink
Added htmlspecialchars() to the example
Browse files Browse the repository at this point in the history
  • Loading branch information
lahdekorpi committed Jan 26, 2012
1 parent 217daee commit 3c56731
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
6 changes: 4 additions & 2 deletions howto.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions input.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -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 <strong>html</html> if planning on echoing directly to a page.
Some more lines1
:A line with indent
Expand Down

0 comments on commit 3c56731

Please sign in to comment.