projectEndings / staticSearch

A codebase to support a pure JSON search engine requiring no backend for any XHTML5 document collection
https://endings.uvic.ca/staticSearch/docs/index.html
Mozilla Public License 2.0
50 stars 22 forks source link

We should warn when no title found #280

Closed martindholmes closed 11 months ago

martindholmes commented 11 months ago

@sydb had some XPath weighting everything outside a particular div at 0, which meant that the document title in the header was nuked before the JSON was created; that meant that no title was found for documents. The function hcmc:getDocTitle() should provide a warning if no usable title is found, because the result is that you get no document title to click on when results are retrieved. Another option would be to never delete anything from the html head element.

martindholmes commented 11 months ago

This should be remedied in both 1.4 and dev.

martindholmes commented 11 months ago

Fixes added in both branches; the test build raises an instance of this error in both branches. However, in the dev branch, something is broken; we're supposed to be using $doc/@id where there is no title, but the badthings.html test file has no id attribute (on purpose), so I think it would be better to do something slightly more sophisticated. Working on that now (only in dev).

martindholmes commented 11 months ago

I've cleaned up some things in dev. I'm going to close this ticket. There is one oddity going on in the test suite but I don't think it relates to this at all.