in reply to Date format in attributes of local XML API

Your example is from noderep xml ticker, which appears to be getting the double-escape of the space as   from calling parseTimeInString (htmlcode). I'm guessing that the entity was inserted accidentally (see patch diff), so it is probably safe to remove the two   completely in that htmlcode (lines 46 and 49).

P.S.: In case there was a legitimate reason for that patch, I didn't create my own since there isn't enough room in the patch reason to explain this.

--== [N] ==--

  • Comment on Re: Date format in attributes of local XML API

Replies are listed 'Best First'.
Re^2: Date format in attributes of local XML API (HTML)
by tye (Sage) on Feb 15, 2015 at 19:29 UTC

    parseTimeInString is returning HTML. The   is useful in some cases. The XML tickers should s/ / /g or parseTimeInString should get another argument specifying that HTML isn't wanted.

    - tye        

      The   is useful in some cases.

      It is used inconsistently, though. Both times   is used ('%b %d, %Y at %H:%M %Z' and /%Y-%m-%d %H:%M:%S %Z/), the other spaces are just normal spaces. I would say just replace the   with normal spaces, but I don't know if the non-breaking space was intentionally included to keep the time zone information with the time.

      --== [N] ==--

        Yes, I realize that not all of the spaces are  . That is intentional, actually. Having no breaking spaces would mean that the dates can't be split at all. Having a non-breaking space between the two shortest elements leads to, when a table is too wide for a display, the date/time being split in a better-looking way.

        It might be good to replace, say, at least the first two spaces in that first string with non-breaking spaces. Though, those are less important because they come at the front of the string where breaking is less likely anyway. I don't use that format so don't have any experience with how that format breaks in an ugly manner in tables displayed at PerlMonks, so my guesses there are less founded so I haven't touched that. But allowing the date/time to break into 2 pieces that are likely to be roughly the same length has proven beneficial when using the other format.

        I don't know if the non-breaking space was intentionally included to keep the time zone information with the time.

        "The   is useful in some cases." Yes, that particular   is useful.

        - tye