Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 53701
Status: rejected
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: pgoetz [...] mail.utexas.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



The CGI.pm HTML generator produces an empty anchor tag: ------------------------------------ lizard:~5.10$ pwd /usr/share/perl/5.10 lizard:~5.10$ perl -e 'use CGI ":standard"; print a({-name=>"my-anchor"}), "\n";' <a name="my-anchor" /> lizard:~5.10$ ----------------------------------- This isn't a valid tag in xhtml (check the DTD for xhtml 1.0 strict or transitional) and in particular, causes problems with firefox and safari (which is how I came to investigate this). The correct representation should be: <a name="my-anchor"></a> This seems like something that would be easy to fix......
Subject: Re: [rt.cpan.org #53701]
Date: Fri, 15 Jan 2010 09:49:25 -0500
To: bug-CGI.pm [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> > The CGI.pm HTML generator produces an empty anchor tag: > > ------------------------------------ > lizard:~5.10$ pwd > /usr/share/perl/5.10 > lizard:~5.10$ perl -e 'use CGI ":standard"; > print a({-name=>"my-anchor"}), "\n";' > <a name="my-anchor" /> > lizard:~5.10$ > ----------------------------------- > > This isn't a valid tag in xhtml (check the DTD for xhtml 1.0 strict or > transitional) and in particular, causes problems with firefox and safari > (which is how I came to investigate this). > The correct representation should be: > <a name="my-anchor"></a>
Thanks. Did you check other tags that should be self-closing or in pairs to see if the issue is isolated to the <a> tag or not? Mark
Subject: Re: [rt.cpan.org #53701]
Date: Fri, 15 Jan 2010 11:00:46 -0600
To: bug-CGI.pm [...] rt.cpan.org
From: Patrick Goetz <pgoetz [...] mail.utexas.edu>
mark@summersault.com via RT wrote: Show quoted text
> > Thanks. Did you check other tags that should be self-closing or in > pairs to see if the issue is isolated to the <a> tag or not? >
I'm sorry, I didn't. I rarely use anything other than the most standard ones (table, Tr, td, p, ul, ol, a, span, form, and div) and I suspect most other people don't, either. Aren't you the one who blogged about not liking the HTML generation features in CGI.pm? <:) There are only 10 tags in xhtml which are allowed to be empty: http://justinsomnia.org/2005/12/there-are-only-10-legal-xhtml-empty-tags/ If you tell me where I can find a complete list of the HTML generation functions CGI.pm supports, I'm happy to test them and report back.
Subject: Re: [rt.cpan.org #53701]
Date: Fri, 15 Jan 2010 14:08:39 -0600
To: bug-CGI.pm [...] rt.cpan.org
From: Patrick Goetz <pgoetz [...] mail.utexas.edu>
mark@summersault.com via RT wrote: Show quoted text
> > Thanks. Did you check other tags that should be self-closing or in > pairs to see if the issue is isolated to the <a> tag or not? >
OK, (based on testing only one other example, p()) it appears that CGI.pm automatically makes an empty tag out of any HTML generating function which has no content; e.g. print p(); produces <p />. This is definitely a bug. BTW, I read your blog post but nevertheless find the HTML generating functions to be an extremely useful way to avoid making or at least quickly finding typographical errors. The functional approach, although not always convenient, frequently simplifies things when I have to spit out a largish collection of nested tags, say a table inside a table inside a div inside another div with p's sprinkled about for good measure, and it helps me sort out the logic in a consist way; e.g. while (x) { push @rows, Tr(...) } print table(@rows);
Subject: Re: [rt.cpan.org #53701]
Date: Fri, 15 Jan 2010 15:17:30 -0500
To: bug-CGI.pm [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> > OK, (based on testing only one other example, p()) it appears that > CGI.pm automatically makes an empty tag out of any HTML generating > function which has no content; e.g. > > print p();
Correct. Show quoted text
> BTW, I read your blog post but nevertheless find the HTML generating > functions to be an extremely useful way to avoid making or at least > quickly finding typographical errors. The functional approach, although > not always convenient, frequently simplifies things when I have to spit > out a largish collection of nested tags, say a table inside a table > inside a div inside another div with p's sprinkled about for good > measure, and it helps me sort out the logic in a consist way; e.g.
While I don't use or endorse this aspect of CGI.pm, I do appreciate that there is more than one way to do it. Your help continuing to look into this would be welcome. The code is on github now: http://github.com/markstos/CGI.pm This might also be useful as a reference: http://github.com/markstos/html--parser--simple/blob/master/lib/HTML/Parser/Simple.pm Near the top there is a data structure listin all the self-closing tags in XHTML. For a change like this, we would also want automated tests included in a patch. Mark
Subject: Re: [rt.cpan.org #53701]
Date: Fri, 22 Jan 2010 15:02:14 -0600
To: bug-CGI.pm [...] rt.cpan.org
From: Patrick Goetz <pgoetz [...] mail.utexas.edu>
mark@summersault.com via RT wrote: Show quoted text
> > Your help continuing to look into this would be welcome. The code is on > github now: > > http://github.com/markstos/CGI.pm >
Sorry for the delayed response -- I've been working on a time critical work project (using CGI.pm!) that had to get finished for the graduate admissions process. I'll take a look at this next week, but will probably have some questions for you, as I've never used github. I'm happy to debug the module, though, if I can.
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/66 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
Rejecting. I'm not accepting any feature requests, patches, or updates to the HTML generating functions of CGI.pm unless they are of a critical nature (i.e. fixing fundamentally broken HTML output). I wouldn't classify invalid html as fundamentally broken HTML output, and next week has now turned into 4.5 years so i'm assuming this is no longer important.
Subject: Re: [rt.cpan.org #53701] Needs Test & Patch: HTML generation: required closing takes are not generated for XHTML
Date: Fri, 11 Jul 2014 11:02:08 -0500
To: bug-CGI [...] rt.cpan.org
From: Patrick Goetz <pgoetz [...] mail.utexas.edu>
Hi - Yes. I've still been using CGI.pm, but just avoid the functions that output invalid HTML. I had plans to fix this simple thing, but never seem to find the time. Otherwise, CGI.pm appears to be a solely maintenance mode undertaking and should probably stay that way, under the circumstances. Thanks. On 07/11/2014 08:46 AM, Lee Johnson via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=53701 > > > Rejecting. I'm not accepting any feature requests, patches, or updates to the HTML generating functions of CGI.pm unless they are of a critical nature (i.e. fixing fundamentally broken HTML output). > > I wouldn't classify invalid html as fundamentally broken HTML output, and next week has now turned into 4.5 years so i'm assuming this is no longer important. >