in reply to Losing <br/> tags after parsing with HTML::TreeBuilder
I can't reproduce the reported behaviour. Here's a standalone example:
#!/usr/bin/perl use warnings; use strict; use HTML::TreeBuilder 5 -weak; my $tree = HTML::TreeBuilder->new; my $content = join "\n", <DATA>; $tree->no_space_compacting(1); $tree->ignore_unknown(0); $tree->parse($content); $tree->eof(); print $tree->as_HTML('<>&'); __DATA__ <html> <head> </head> <body> <i>adv.</i><br/><b>1</b> <span lang="pt">maldosamente</span><br/><b>2< +/b> <span lang="pt">maliciosamente</span><br/><b>3</b> <span lang="pt +">intencionalmente</span> </body></html>
The output on my machine:
<html><head></head><body><i>adv.</i><br /><b>1</b> <span lang="pt">mal +dosamente</span><br /><b>2</b> <span lang="pt">maliciosamente</span>< +br /><b>3</b> <span lang="pt">intencionalmente</span></body></html>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Losing <br/> tags after parsing with HTML::TreeBuilder
by 1nickt (Canon) on Jun 05, 2025 at 09:38 UTC | |
Re^2: Losing <br/> tags after parsing with HTML::TreeBuilder
by Markismus (Acolyte) on Jun 05, 2025 at 09:45 UTC | |
by choroba (Cardinal) on Jun 05, 2025 at 09:49 UTC | |
by Markismus (Acolyte) on Jun 05, 2025 at 11:11 UTC |