sunaku/dasht

Issue opening guides and sections

thornycrackers opened this issue · 3 comments

First off, thank you for the awesome application this is such a lifesaver. The problem I'm having is that I can download the docsets and they load up but whenever I try to load a page that is either a section or a guide I'm running into trouble.

E.g. I download the Django docs and search for migrations:

$ dasht 'migration' django

Near the bottom is an item named "Writing database migrations" and when I try to open it I get the following error:

Can't load file:///home/thorny/.local/share/dasht/docsets/Django.docset/Contents/Resources/Documents/<dash_entry_menuDescription=howto/writing-migrations><dash_entry_name=Writing%20database%20migrations>doc/howto/writing-migrations.

I'm sure it would go longer but I can't see the end. I can go to the docs directory and find the file at

/home/thorny/.local/share/dasht/docsets/Django.docset/Contents/Resources/Documents/doc/howto/writing-migrations.html

So I know it's there but it looks like an error in the link? It isn't limited to the django docs either I also get them in the python3 docs. It seems to be occuring for guides and sections.

The problem lies in the docset itself: the Django docset's internal database row for that topic is like this:

Z_PK|Z_ENT|Z_OPT|ZALPHASORTORDER|ZFIRSTLOWERCASEUTF8BYTE|ZCONTAINER|ZLANGUAGE|ZMETAINFORMATION|ZPARENTNODE|ZTOKENTYPE|ZTOKENNAME|ZTOKENUSR|Z_PK|Z_ENT|Z_OPT|ZDECLAREDIN|ZFILE|ZRETURNVALUE|ZTOKEN|ZABSTRACT|ZANCHOR|ZDECLARATION|ZDEPRECATIONSUMMARY|Z_PK|Z_ENT|Z_OPT|ZPATH|Z_PK|Z_ENT|Z_OPT|ZTYPENAME
2096|14|2|3847|119||1|2412||9|Writing database migrations||2412|16|1||365||2096|||||365|6|1|<dash_entry_menuDescription=howto/writing-migrations><dash_entry_name=Writing%20database%20migrations>doc/howto/writing-migrations.html|9|17|1|Guide

Please try the fix I pushed to the issue-28 branch, which strips out all embedded XML from URL fields.

Fix pushed to master branch now. 🤕 Thanks for reporting this issue. 👍 Closing.

Works well, Thanks so much!