Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Ordering meta tags with HTML::Element

by Cow1337killr (Monk)
on Jun 21, 2016 at 20:44 UTC ( [id://1166216]=note: print w/replies, xml ) Need Help??


in reply to Ordering meta tags with HTML::Element

Here is a program I threw together after surfing the Internet.
#!/usr/bin/perl # html_indenting2.pl perl html_indenting2.pl HTML indenting wit +h Perl. # From http://stackoverflow.com/questions/8225194/html-indenting-with- +perl best answer use strict; use warnings; use HTML::HTML5::Parser qw(); use HTML::HTML5::Writer qw(); use XML::LibXML::PrettyPrint qw(); print HTML::HTML5::Writer->new( start_tags => 'force', end_tags => 'force', )->document( XML::LibXML::PrettyPrint->new_for_html( indent_string => "\t" )->pretty_print( HTML::HTML5::Parser->new->parse_string( q[<meta content="J K Rolling" name="Author" /> <meta content="Harry Potter and the Philosopher's Stone" name="title" +/> ] ) ) ); # This prints: # <!DOCTYPE html><html> # <head> # <meta content="J K Rolling" name=Author> # <meta content="Harry Potter and the Philosopher's St +one" name=title> # </head> # <body></body> # </html> __END__
The order of the meta content is the way you want it.

Replies are listed 'Best First'.
Re^2: Ordering meta tags with HTML::Element
by Anonymous Monk on Jun 22, 2016 at 06:38 UTC

    The order of the meta content is the way you want it.

    No it isn't, its same problem as in the OP, not the order that "it should be"

      Oh, dear. I'm sorry.

      I promise I will double-check and triple-check my results from now on.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-18 20:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found