hsmyers has asked for the wisdom of the Perl Monks concerning the following question:

Given a pod fragment like:
=begin html <br>Figure 1.<IMG SRC="figure1.png"><br> =end html
why does pod2html translate it to:
<PRE> <CODE> <HTML> <HEAD> <TITLE>wall.txt</TITLE> <LINK REV="made" HREF="mailto:"> </HEAD> <BODY> <A NAME="__index__"></A> <!-- INDEX BEGIN --> <!-- INDEX END --> <P>&lt;br&gt;Figure 1.&lt;IMG SRC=``figure1.png''&gt;&lt;br&gt;</P> </BODY> </HTML>

Before any suggest RTFM, the example is taken from perlpod itself. Podchecker also reports no problems. I've not yet begun to dive into the source, but if this isn't a bug, it's certainly not a very useful feature. I do know that if you comment out the blank lines in the source, it translates correctly—so it obviously is related to the blank line problem referred to in Common Pod Pitfalls even though these lines have no spaces that might cause problems.

hsm

Replies are listed 'Best First'.
Re: Pod2html Problem
by japhy (Canon) on Sep 26, 2001 at 02:03 UTC
    I believe this is a bug in Pod::Html that I fixed recently. The latest version from CPAN should work properly.

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

      Jeff,

      I just hit CPAN and your website—no mention of a revised Pod::Html. Which of the several available on CPAN would it be?

      hsm
        The one distributed with Perl 5.7.2. The patch was just one line, I think.

        _____________________________________________________
        Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
        s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

      Jeff,

      Thanks again—Pod::Html version 1.4 did the trick...

      hsm
Re: Pod2html Problem
by jmcnamara (Monsignor) on Sep 26, 2001 at 02:47 UTC

    I encountered this before and got around it by ommiting the newline after =begin html.
    =begin html <br>Figure 1.<IMG SRC="figure1.png"><br> =end html
    This works with Perl 5.6 and 5.005. It isn't related to the blank line problem referred to in "Common Pod Pitfalls ". Almost certainly a bug.

    John.
    --

      Trouble is, any newline in the =begin to =end range causes the formatter to go nuts. Which is why I said it seemed related— although not the way mentioned in CPP

      hsm

(crazyinsomniac) Re: Pod2html Problem
by crazyinsomniac (Prior) on Sep 26, 2001 at 09:16 UTC
    Others have shown what the problem is, and how it was fixed, but if you're ever in a bind, you can try =for as an alternative to =begin and =end (like perlpod says you can ;D)
    =pod =head1 HTML =for html <H1>H1</H1> Hellow baby, <HR> Hello!<HR> =head1 HEAD Manyousegottsadirtymind =cut ### PRODUCES(`pod2html --outfile frk.html --infile graphc.pl --title t +it`) <HTML> <HEAD> <TITLE>tit</TITLE> <LINK REV="made" HREF="mailto:"> </HEAD> <BODY> <A NAME="__index__"></A> <!-- INDEX BEGIN --> <UL> <LI><A HREF="#html">HTML</A></LI> <LI><A HREF="#head">HEAD</A></LI> </UL> <!-- INDEX END --> <HR> <P> <HR> <H1><A NAME="html">HTML</A></H1> <H1>H1</H1> Hellow baby, <HR> Hello!<HR><P> <HR> <H1><A NAME="head">HEAD</A></H1> <P>Manyousegottsadirtymind</P> </BODY> </HTML>

     
    ___crazyinsomniac_______________________________________
    Disclaimer: Don't blame. It came from inside the void

    perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"