diff options
author | Andrew Dolgov <[email protected]> | 2023-10-18 20:14:54 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-18 20:14:54 +0300 |
commit | 9f72616818daf2b3d01a580f0eda634c08513077 (patch) | |
tree | 7fd9f598278042f485f196982eceab76fde9f336 /vendor/soundasleep/html2text/convert.php | |
parent | 89f5af62d8d6c71043eb855a333acaca333ef297 (diff) |
use html2text() instead of strip_tags() when making FTS indexes
Diffstat (limited to 'vendor/soundasleep/html2text/convert.php')
-rw-r--r-- | vendor/soundasleep/html2text/convert.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/soundasleep/html2text/convert.php b/vendor/soundasleep/html2text/convert.php new file mode 100644 index 000000000..48094eb21 --- /dev/null +++ b/vendor/soundasleep/html2text/convert.php @@ -0,0 +1,21 @@ +<?php +/** + * This file allows you to convert through the command line. + * Usage: + * php -f convert.php [input file] + */ + +if (count($argv) < 2) { + throw new \InvalidArgumentException("Expected: php -f convert.php [input file]"); +} + +if (!file_exists($argv[1])) { + throw new \InvalidArgumentException("'" . $argv[1] . "' does not exist"); +} + +$input = file_get_contents($argv[1]); + +require_once(__DIR__ . "/src/Html2Text.php"); +require_once(__DIR__ . "/src/Html2TextException.php"); + +echo \Soundasleep\Html2Text::convert($input); |