| 1 |
Using HTML::StripScripts directly |
| 2 |
--------------------------------- |
| 3 |
|
| 4 |
HTML::StripScripts expects a stream of tokens. Normally, to parse HTML, you |
| 5 |
would use HTML::StripScripts::Parser or HTML::StripScripts::LibXML. |
| 6 |
|
| 7 |
If, however, you are generating the tags yourself, and want to use |
| 8 |
HTML::StripScripts directly, you need to pass it the tokens in order. |
| 9 |
|
| 10 |
Look at examples/direct/direct.pl for an example of how to do this. |
| 11 |
|
| 12 |
To run the example, type: |
| 13 |
|
| 14 |
perl examples/direct/direct.pl |
| 15 |
|
| 16 |
This script passes <ul> and <li> tags, along with one bad </li> tag, ie there is |
| 17 |
no corresponding opening <li>, so this tag is filtered. |