Skip to content

Invalid html from _repr_html_() #955

@pjhartzell

Description

@pjhartzell

When viewing the html generated by the _repr_html() method of a Collection or Catalog (e.g., in a notebook or browser), there are missing Target fields in some of the links. This appears to be due to invalid html. For example, something like this in a notebook...

import pystac
pystac.Collection.from_file("data-files/catalogs/test-case-1/country-1/area-1-1/collection.json")

...will be missing some Link Target values:

Screen Shot 2023-01-18 at 9 25 04 AM

Looking at the html for that first circled link...

        <table style="width: 100%; text-align: left;">
            <tr><td style="text-align: left;"><strong>Rel:</strong> root </td></tr>
            <tr><td style="text-align: left;"><strong>Target:</strong> <Catalog id=test> </td></tr>
            
                <tr><td style="text-align: left;"><strong>Media Type:</strong> application/json </td></tr>
            
            
        </table>

...the problem seems to be the invalid tag: <Catalog id=test>. I think the link address should replace the tag.


There are a few other minor items that could be included in a fix for this issue

  1. Not all field titles, e.g., the Collection ID in the example above, are in bold font.
  2. Might be worth adding <!DOCTYPE html> and enclosing the content in <html></html> tags.

Metadata

Metadata

Assignees

Labels

bugThings which are broken

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions