Re: [Mojolicious] How include HTML as HTML in templates?

2015-11-30 Thread Helmut Wollmersdorfer
Oh, thx. It's always good to have more than one solution. Let me ask an additional question. The HTML to include is large, typically ~100 KB, and can be prepared down to the necessary fragment in batch. Batch manipulation is still necessary for other reasons. This does not save much of the siz

Re: [Mojolicious] How include HTML as HTML in templates?

2015-11-30 Thread Jan Henning Thorsen
You can also turn the string into a ByteStream object: # this... use Mojo::ByteStream "b"; my $x = b "hello!"; $c->stash(x => $x); # or this... $c->stash(x => $c->b("Hello!")); https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Plugin/DefaultHelpers.pm#b On Monday,

Re: [Mojolicious] How include HTML as HTML in templates?

2015-11-23 Thread Helmut Wollmersdorfer
Am Montag, 23. November 2015 09:22:04 UTC+1 schrieb Luc didry: > > > Simple: just use <%== instead of <%= (which XML escape the result). > OMG, forgot this feature. Thx Helmut Wollmersdorfer -- You received this message because you are subscribed to the Google Groups "Mojolicious" group.

Re: [Mojolicious] How include HTML as HTML in templates?

2015-11-23 Thread Luc didry
Le Monday 23 November 2015, 00:10:39 Helmut Wollmersdorfer a écrit : > Hi, > > I want to include HTML as content into a template. > > This is my code so far: > > sub show { > my $self = shift; > > my $html = 'test'; > > my $dom = Mojo::DOM->new($html); > > my $content = $dom->at('div.

[Mojolicious] How include HTML as HTML in templates?

2015-11-23 Thread Helmut Wollmersdorfer
Hi, I want to include HTML as content into a template. This is my code so far: sub show { my $self = shift; my $html = 'test'; my $dom = Mojo::DOM->new($html); my $content = $dom->at('div.ocr_page')->to_string; $self->stash->{hocr} = $content; $self->render(); } And the templat