Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 539 forks source link

Pod::Html generates incorrect href's in some html anchors #8423

Closed p5pRT closed 18 years ago

p5pRT commented 18 years ago

Migrated from rt.perl.org#39020 (status was 'resolved')

Searchable as RT39020$

p5pRT commented 18 years ago

From bgstewart@covad.net

Created by bgstewart@covad.net

This is a bug report for perl from bgstewart@​covad.net\, generated with the help of perlbug 1.35 running under perl v5.8.8.

----------------------------------------------------------------- Pod​::Html generates bad links for multiple-line =head# paragraphs that include X\<> elements. Other directives that generate HTML Anchors may exhibit the same problem.

An example from perlop.pod in the base documentation​:

=head2 Operator Precedence and Associativity X\<operator\, precedence> X\ X\

produces​: \

\Operator Precedence and Associativity   \\

rather than the more useful​: \

\Operator Precedence and Associativity   \\

I believe the problem lies in sub dpod1 as indicated below.

Thanks. Bruce Stewart

sub depod1($;$$){   my( $rstr\, $func\, $closing ) = @​_;   my $res = '';   return $res unless defined $$rstr;   if( ! defined( $func ) ){   # skip to next begin of an interior sequence   while( $$rstr =~ s/\A(.*?)([BCEFILSXZ])\<(\<+[^\S\n]+)?// ){ # previous line should be # while( $$rstr =~ s/\A(.*?)([BCEFILSXZ])\<(\<+[^\S\n]+)?//s ){ #   # recurse into its text   $res .= $1 . depod1( $rstr\, $2\, closing $3);   }   $res .= $$rstr;   } elsif( $func eq 'E' ){   # E\ - convert to character   $$rstr =~ s/^([^>]*)>//;   $res .= $E2c{$1} || "";   } elsif( $func eq 'X' ){   # X\<> - ignore   $$rstr =~ s/^[^>]*>//;   } elsif( $func eq 'Z' ){   # Z\<> - empty   $$rstr =~ s/^>//;   } else {   # all others​: either recurse into new function or   # terminate at closing angle bracket   my $term = pattern $closing;   while( $$rstr =~ s/\A(.*?)(([BCEFILSXZ])\<(\<+[^\S\n]+)?|$term)// ){ # previous line should be # while( $$rstr =~ s/\A(.*?)(([BCEFILSXZ])\<(\<+[^\S\n]+)?|$term)//s ){ #   $res .= $1;   last unless $3; [...]

Perl Info ``` Flags: category=library severity=low Site configuration information for perl v5.8.8: Configured by builder at Mon Mar 20 17:54:00 2006. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='12.00.8804', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -machine:x86' libpth=\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\Perl\lib\CORE" -machine:x86' Locally applied patches: ACTIVEPERL_LOCAL_PATCHES_ENTRY Iin_load_module moved for compatibility with build 806 Avoid signal flag SA_RESTART for older versions of HP-UX PerlEx support in CGI::Carp Less verbose ExtUtils::Install and Pod::Find Patch for CAN-2005-0448 from Debian with modifications Partly reverted 24733 to preserve binary compatibilty 27528 win32_pclose() error exit doesn't unlock mutex 27527 win32_async_check() can loop indefinitely 27515 ignore directories when searching @INC 27359 Fix -d:Foo=bar syntax 27210 Fix quote typo in c2ph 27203 Allow compiling swigged C++ code 27200 Make stat() on Windows handle trailing slashes correctly 27194 Get perl_fini() running on HP-UX again 27133 Initialise lastparen in the regexp structure 27034 Avoid \"Prototype mismatch\" warnings with autouse 26970 Make Passive mode the default for Net::FTP 26921 Avoid getprotobyname/number calls in IO::Socket::INET 26897,26903 Make common IPPROTO_* constants always available 26670 Make '-s' on the shebang line parse -foo=bar switches 26379 Fix alarm() for Windows 2003 26087 Storable 0.1 compatibility 25861 IO::File performace issue 25084 long groups entry could cause memory exhaustion 24699 ICMP_UNREACHABLE handling in Net::Ping @INC for perl v5.8.8: C:/Perl/lib C:/Perl/site/lib . Environment for perl v5.8.8: HOME=H:\ LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=C:\Perl\bin;C:\MKS\bin;C:\MKS\bin\x11;C:\MKS\mksnt;C:\Program Files\tcl84\bin;C:\Program Files\Tcl83\bin;C:\Python24\.;C:\Program Files\imagemagick-5.5.6-q16;C:\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\UltraEdit;C:\Program Files\Debugging Tools for Windows;C:\TIBCO\TIBRV71\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Subversion\bin;C:\Program Files\Objective Caml\bin;C:\Program Files\Gltrade\apitools\bin;C:\Program Files\Gltrade\apitools\tools PERL_BADLANG (unset) SHELL=C:\MKS\mksnt\sh.exe ```
p5pRT commented 18 years ago

From nospam-abuse@bloodgate.com

Moin\,

----------------------------------------------------------------- Pod​::Html generates bad links for multiple-line =head# paragraphs that include X\<> elements. Other directives that generate HTML Anchors may exhibit the same problem.

An example from perlop.pod in the base documentation​:

=head2 Operator Precedence and Associativity X\<operator\, precedence> X\ X\

As far as I know POD\, there should be an empty line after the =head2. I
think this is a bug in the POD\, not the converter.

Attached is what "podcheck" has to say.

Pod​::Simple doesn't report any errors or warnings\, tho.

Best wishes\,

Tels

-- Signed on Sat Apr 29 16​:30​:21 2006 with key 0x93B84C15. Visit my photo gallery at http​://bloodgate.com/photos/ PGP key on http​://bloodgate.com/tels.asc or per email.

"Our second big loss has been the "IP" fudge\, which is blurring the distinctions between patents\, copyrights\, trademarks\, trade secrets\, competative advantages\, wishful thinking\, bullshit\, and marketing babble into one vague pile of lawyer poo." -- MarkusQ (450076)\, 2004-01-23

p5pRT commented 18 years ago

From nospam-abuse@bloodgate.com

*** WARNING​: multiple occurrence of link target 'tr' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '\n' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'quote\, double' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'backtick' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '-' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '\r' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'list operator' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '*' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '//' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '"' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '(TYPE)' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '/m' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '''' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '\<\<' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'qq' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '&' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '`' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'operator\, logical\, and' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'qx' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'qr' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '/i' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '""' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'm' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '/s' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '/x' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'operator\, logical\, or' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'q' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '/c' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '``' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '+' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target ''' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target '/o' at line - in file blead/pod/perlop.pod *** WARNING​: multiple occurrence of link target 'qw' at line - in file blead/pod/perlop.pod blead/pod/perlop.pod pod syntax OK.

p5pRT commented 18 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 18 years ago

From rra@stanford.edu

Tels \nospam\-abuse@&#8203;bloodgate\.com writes​:

Moin\,

----------------------------------------------------------------- Pod​::Html generates bad links for multiple-line =head# paragraphs that include X\<> elements. Other directives that generate HTML Anchors may exhibit the same problem.

An example from perlop.pod in the base documentation​:

=head2 Operator Precedence and Associativity X\<operator\, precedence> X\ X\

As far as I know POD\, there should be an empty line after the =head2. I
think this is a bug in the POD\, not the converter.

That would make the X\<> sequences part of the following paragraph instead of part of the heading. I believe the intention is that they be part of the heading.

So far as I know\, this is valid POD\, if unusual.

-- Russ Allbery (rra@​stanford.edu) \<http​://www.eyrie.org/~eagle/>

p5pRT commented 18 years ago

From @smpeters

On Fri\, Apr 28\, 2006 at 03​:12​:29PM -0700\, bgstewart@​covad.net wrote​:

# New Ticket Created by bgstewart@​covad.net # Please include the string​: [perl #39020] # in the subject line of all future correspondence about this issue. # \<URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=39020 >

This is a bug report for perl from bgstewart@​covad.net\, generated with the help of perlbug 1.35 running under perl v5.8.8.

----------------------------------------------------------------- Pod​::Html generates bad links for multiple-line =head# paragraphs that include X\<> elements. Other directives that generate HTML Anchors may exhibit the same problem.

An example from perlop.pod in the base documentation​:

=head2 Operator Precedence and Associativity X\<operator\, precedence> X\ X\

produces​: \

\Operator Precedence and Associativity \\

rather than the more useful​: \

\Operator Precedence and Associativity \\

I believe the problem lies in sub dpod1 as indicated below.

This problem was fixed with a combination of Changes #27832 and #27847 in bleadperl.

Steve Peters steve@​fisharerojo.org

p5pRT commented 18 years ago

@smpeters - Status changed from 'open' to 'resolved'