https://github.com/yanick/escape-houdini
https://github.com/yanick/escape-houdini
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yanick/escape-houdini
- Owner: yanick
- Created: 2013-05-08T00:51:42.000Z (about 12 years ago)
- Default Branch: main
- Last Pushed: 2020-11-17T00:28:05.000Z (over 4 years ago)
- Last Synced: 2025-03-22T08:51:22.397Z (2 months ago)
- Language: Perl
- Homepage:
- Size: 105 KB
- Stars: 2
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# NAME
Escape::Houdini - Perl API to Houdini, a zero-dependency C web escaping library
# VERSION
version 0.3.3
# SYNOPSIS
```perl
use Escape::Houdini ':all';my $escaped = escape_html( '' );
# $escaped is now '<foo>'
```# DESCRIPTION
_Escape::Houdini_ is a wrapper around the zero-depedency, minimalistic
web escaping C library [Houdini](https://github.com/vmg/houdini).This version of _Escape::Houdini_ has been built against
the commit
[https://github.com/vmg/houdini/commit/3e2a78a2399bf3f58253c435278df6daf0e41740](https://github.com/vmg/houdini/commit/3e2a78a2399bf3f58253c435278df6daf0e41740)
of Houdini.# FUNCTIONS
## escape\_html( $text )
```perl
escape_html( '' ); # => '<body class="foo">'
```## unescape\_html( $text )
```perl
unescape_html( "<body>" ); # => ''
```## escape\_xml( $text )
```perl
escape_xml( "" ); # => '<foo>'
```## escape\_uri( $text )
## unescape\_uri( $text )
## escape\_url( $text )
```perl
escape_url("http://foo.com/meh"); # => 'http%3A%2F%2Ffoo.com%2Fmeh'
```## unescape\_url( $text )
```perl
unescape_url('http%3A%2F%2Ffoo.com%2Fmeh'); # => "http://foo.com/meh"
```## escape\_href( $text )
## escape\_js( $text )
```perl
escape_js( "foo\nbar" ); # => 'foo\nbar'
```## unescape\_js( $text )
```perl
escape_js( 'foo\nbar' ); # => "foo\nbar"
```# EXPORTS
_Escape::Houdini_ doesn't export any function by default. Functions can be
exported individually, or via the following tags:```
| tag | exported functions |
|-------|----------------------------|
| :all | all o' them |
| :html | escape_html, unescape_html |
| :uri | escape_uri, unescape_uri |
| :url | escape_url, unescape_url |
| :js | escape_js, unescape_js |
```# SEE ALSO
Houdini (natch) - [https://github.com/vmg/houdini](https://github.com/vmg/houdini)
# AUTHOR
Yanick Champoux [](http://coderwall.com/yanick)
# COPYRIGHT AND LICENSE
This software is copyright (c) 2020, 2019, 2017, 2014, 2013 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.