in reply to Newlines in HTML::LoL

Hi

did you try

hl_preserve(...) ?

From the docs:

- hl_preserve(...)

Normally, HTML::LoL tries to optimize the whitespace in the HTML it emits (without changing the meaning of the HTML). This suppresses that behavior within its arguments.

update

HINT: If you want good and quick answers to exotic modules, try linking to them with [mod://...] to help those who wanna help you...

Like [mod://HTML::LoL] --> HTML::LoL

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

Replies are listed 'Best First'.
Re^2: Newlines in HTML::LoL
by BernieC (Pilgrim) on Feb 01, 2021 at 18:05 UTC
    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.
      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

      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