Tags:
create new tag
, view all tags

Question

I have a script I wish to dissuss/comment on. That includes a line:


$html =~ s/<\/head>/<base href="$baseurl"<\n<\/head</i;
In it's original format the start of the <base href tag breaks lots of stuff. Even now the above line in preview is wrong ("/cgi-bin/oops/Support/BaseHRefIssue?template=oops" vs "$baseurl").

If I change the &lt, &gt around base href to <, > I can't even save the page.

  • TWiki version: ONLINE
  • Web server: ONLINE
  • Server OS: ONLINE

P.S., in 010315Beta it works "corretly", but behaviour varries between NS and IE

-- DrewCard - 14 Jun 2001

Answer

Have you tried putting the script text in <verbatim> tags, e.g.:

$html =~ s/<\/head>/<base href="$baseurl">\n<\/head>/i;
This avoids breaking the HTML. However, it does not fix the preview showing oops-type URLs, which IMO is a bug. The <verbatim> tag requires the Dec 2000 TWiki build at least, before that you have <pre> which is not so good.

Since we are discussing this code ... this can be written avoiding the /-escapes etc as:

$html =~ s#</head>#<base href="$baseurl">\n$1#i;

-- RichardDonkin - 14 Jun 2001

It seems the <verbatim></verbatim> tags are just the trick...

-- DrewCard - 15 Jun 2001

Topic revision: r4 - 2001-06-16 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.