Write valid HTML log files

#312 Open

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update release-2.x.y
hg pull -r trac-17280-valid-log-html https://bitbucket.org/strangeways/main
hg merge trac-17280-valid-log-html
hg commit -m 'Merged in strangeways/main/trac-17280-valid-log-html (pull request #312)'
  1. Daniel Kamil Kozar

This patch makes the libpurple HTML log writer create HTML log files
which are valid HTML. The simplest log created before the patch caused
the W3C Validator to return 1 error and 3 warnings, while the patched
version validates without errors or warnings.

All credit goes to the original patch author, stars (ticket 17280).

  • 1 open task

Comments (12)

      • look into h1 tag stuff
  1. Daniel Kamil Kozar author

    First of all, very sorry about the long silence.

    Here’s what it all boils down to :

    • html_logger_read() returns the contents of the HTML log without the first line.
    • In the “old” format (pre-this-commit), the first line is the one that contains the <h3> tag, and that’s why it does not end up in the log window.
    • Even though gtkimhtml.c declares VALID_TAG(“H3”), its processing does not do anything, and does not skip the text inside <h3> : this can be confirmed by moving the <h3> tag to the second line in “old” log files.
    • Declaring VALID_TAG(“H1”) and adding the appropriate case statement (i.e. so that <h1> is handled the same as <h3>) does not do anything, in line with the point above.

    All in all, it seems like adding code to gtkimhtml.c so that it handles <h1> as “skip all the text until the tag ends” should be enough : I haven’t tried that yet, though, but there are a few handlers that do exactly this kind of thing.

    Edit : or we could just leave the newlines alone and call it a day… sounds like the best idea to be honest. If anybody wants to actually look at these HTML files in an editor, there’s nothing stopping them from using html-tidy first.

      1. Daniel Kamil Kozar author


        To be honest, it doesn’t seem “ignorable” to me : the output is just broken, since the first line (“Conversation with …”) simply doesn’t belong in the right pane and should appear in the window’s header only.

        I still think leaving the newlines alone is the best thing to do.