Thank you for the fast reply and implementing this.
After running:
composer require htmlawed/htmlawed-class
I ran into some minor issues that might require some small additional changes to the class:
First, due to: 'Class 'htmLawed\htmLawed' not found'
above:
I added:
Then due to warnings like:
'preg_replace_callback(): Requires argument 2, 'htmLawed::hl_tag', to be a valid callback'
I replaced all occurrences of 'htmLawed::' with 'self::' which from my reading should be the same (but see: https://stackoverflow.com/questions/3481085/self-vs-classname-inside-static-classname-methods-in-php). Alternatively, the namespace could be specified in full, i.e. 'htmLawed\htmLawed::'
After the above minor changes, things appear to work well (autoloading as expected---called as normal, though now specifying a namespace):
use htmLawed\htmLawed;
$out = htmLawed::hl($in, $config);
Perhaps "psr-4": { "htmLawed\\" : ""} could be more specific as "psr-4": { "htmLawed\\" : "htmlawed-class"}. Though I don't think would make a huge difference as the array key/value pair in the composer generated 'autoload_psr4.php' already looks good to me:
'htmLawed\\' => array($vendorDir . '/htmlawed/htmlawed-class'),