Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Newlines in HTML::LoL

by BernieC (Pilgrim)
on Feb 01, 2021 at 18:05 UTC ( [id://11127753]=note: print w/replies, xml ) Need Help??


in reply to Re: Newlines in HTML::LoL
in thread Newlines in HTML::LoL

Sorry about that -- I didn't realize HTML::LoL was an exotic/strange module. I"m using CGI::Simple and I wanted to supplement it with something similarly simple to generate the HTML. I know that that the one-line HTML is perfectly legal, but that was a test to see how HTML::LoL worked. In my actual web page the HTML will be a lot more complicated and it'll be easier for me to see what I messed up in the array refs and stuff if the HTML is nicely, rather than just legally, formatted.

Replies are listed 'Best First'.
Re^3: Newlines in HTML::LoL
by LanX (Saint) on Feb 01, 2021 at 18:11 UTC
    No need to apologize it's just that you'll get more answers if you link to the modules in question.

    FWIW: I'm using an JS-addon which does auto-linking of colon separated strings like CGI::Simple --> CGI::Simple .

    See link in my signature if interested.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re^3: Newlines in HTML::LoL
by BernieC (Pilgrim) on Feb 01, 2021 at 18:14 UTC
    h1_preserve didn't work at all. What I got back for the same program, but the h1 changed to hl_preserve was an array ref, no text at all and a dd on the result showed me:
    [ bless(do{\(my $o = "preserve")}, "HTML::LoL::Special"), sub { ... }, [ "HTML", [ "BODY", [ "FORM", ["LABEL", { for => "user" }, "Who are you?"], ["INPUT", { name => "user", type => "text" }], ], ], ], ]
    which isn't quite what I wanna send to a browser :)
      Sorry, no idea!

      I'm normally fond of DSLs ... but this module doesn't look so promising, that I'd like to try it. :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        how annoying. This is the example in the POD:
        &hl(sub { print shift }, [table => {border => 2, width => '80%'}, [tr => [td => {nowrap => &hl_bool(1)}, 'This & that'], [td => {nowrap => &hl_bool(0)}, '<b>This is not bold</b>'], [td => [b => 'But this is']], [td => &hl_noquote('<b>And so is this</b>')]]]);
        and it produces:
        <table border="2" width="80%"> <tr> <td nowrap>This &amp; that</td> <td>&lt;b&gt;This is not bold&lt;/b&gt;</td> <td><b>But this is</b></td> <td><b>And so is this</b></td> </tr> </table>
        I can't figure out what's right with their example and what's wrong with my usage.. and it doens't look like there's another module for generating HTML structurally ... sigh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127753]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-18 23:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found