Hi,
Inliner works best for atomic documents, as the workflow is substantially simpler. For example if you provide a document that includes a single stylesheet within the html itself (rather than linked) you're going through an unambiguous set of behavior.
This is actually what it was designed for from the ground up. Specifically it was designed to facilitate inlining styles for use with email. In these cases you almost always have all the assets within a single document. There are quite a few people using the tool for this explicit purpose, and to that end it works rather well.
For remote documents things get dicier because behavior becomes ambiguous. Should it die, or provide a warning, or keep going as if nothings wrong? There is no clear answer on what's best for everyone.
Your point below is well taken, and I'd suggest writing a patch to make it behave in such a way, and we'll see if that ends up being viable or breaks existing implementations in the wild. I think probably we could make it work in a way whereby it afforded itself to more people while die'ing less. In such a case, then yeah, this is a good idea.
-Kevin
On Mon Apr 08 21:19:36 2013, JJSIMONI wrote:
Show quoted text> Is there a good reason that this module is designed to die(), if you
> feed it a string, with a linked stylesheet? If anything, wouldn't
> it be best to simply warn() about that, or even better, deal with
> it, transparently if there's a base url, ala:
>
> my $inliner = CSS::Inliner->new();
> $inliner->read(
> {
> html => $s,
> base_url => '
http://example.com',
> }
> );
>
>