in reply to Ordering meta tags with HTML::Element

html doesn't care about ordering, so neither does HTML::Element, and neither should you ... but if you want to change it start by copy/pasting the source of as_HTML and changing it fit your desires
  • Comment on Re: Ordering meta tags with HTML::Element

Replies are listed 'Best First'.
Re^2: Ordering meta tags with HTML::Element
by Your Mother (Archbishop) on Jun 14, 2016 at 22:37 UTC

    This is partially true. There are two? three? more? meta tags that are required to go first including some display related stuff and the always #1, since it affects everything that follows, <meta charset="UTF-8">.

      Elements are ordered. Attributes are not.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

        Well it's a glaring omission then. The <title>O̴̡̾ͫ̈́̿̑ͤͣ̾͛́́̀͞͏̝̝̘̪̮̹̪͎͚̞̟̣̱̤̘̺͕̪H̅ͧ͛ͧ̾͒ͫ҉҉͉̳̘̭̫̯ͅÄ̵̸͙̩̱̝͙̱̫̜͙̰̻̝͕͉̭̮̖͖͇́̊ͮͩ̅̌̈́ͮͧ̀́͞I̡̞̗͈͙̠͓͉̯̝̮̲̮͕̣̭̪̾͛̅̉́ͅ </title> may not be ASCII so the encoding RFC:MUST be known before parsing any content including other meta tags which might have encoded attributes. You have to know the encoding, and you have have to know it first, not after mish-mashing things together and guessing and hoping and blaming the spec. :P

        And the obvious rebuttal will be Content-Type. Yes, it is necessary to be there and correctly agree but after a file is downloaded or opened locally, there are no server headers. The <meta/> should be there and has to be first to be perfectly robust.