Subject: | Problem inserting JavaScript when HEAD has attributes (w/patch) |
Hi,
Thanks for the module! It's very helpful. I have a problem, however,
when I create an HTML document that has a <HEAD> element with attributes
(e.g., "bgcolor"). This fixes it:
diff -c Ajax.orig Ajax.pm
*** Ajax.orig Wed Jun 7 13:56:57 2006
--- Ajax.pm Wed Jun 7 13:57:28 2006
***************
*** 956,962 ****
}
# see if we can match on <head>
! @shtml= $mhtml =~ /(.*)(<\s*head\s*>)(.*)/is;
if ( @shtml ) {
# yes, there's already a <head></head>, so let's insert inside it,
# at the beginning
--- 956,962 ----
}
# see if we can match on <head>
! @shtml= $mhtml =~ /(.*)(<\s*head.*?>)(.*)/is;
if ( @shtml ) {
# yes, there's already a <head></head>, so let's insert inside it,
# at the beginning
ky