canonical / canonicalwebteam.discourse

GNU Lesser General Public License v3.0
11 stars 16 forks source link

Fix unexpected render of any discourse topic #115

Closed carkod closed 2 years ago

carkod commented 2 years ago

Done

QA

Additionally, to be 100% sure we are not breaking other docs (if any of the other docs have some obscure feature), we can try the same thing on anbox-cloud.io/docs/t/nvidia-driver-specific-flutter-bug/25269, maas.io/docs/t/nvidia-driver-specific-flutter-bug/25269, ubuntu.com/openstack/install which also pull content from discourse see if there are any issues.

Issues

Fixes #114

jkfran commented 2 years ago

This is nice, but I think it can break the multiple versions docs,_get_url_topic_id can be used just to extract the topic id of an URL without being in the url_map. I think the fix might be on a different method, let me do some testing.

carkod commented 2 years ago

This is nice, but I think it can break the multiple versions docs,_get_url_topic_id can be used just to extract the topic id of an URL without being in the url_map. I think the fix might be on a different method, let me do some testing.

I am trying to set up a mass test docs with the multiple versions index topic and I'm getting, because I'm a new user on discourse.maas.io and I can't pull this content...

File "/home/carkod/.local/lib/python3.9/site-packages/canonicalwebteam/discourse/parsers/docs.py", line 324, in _parse_navigation_versions
    for version in self.versions:
TypeError: 'NoneType' object is not iterable

I guess I can also move it up to the document_view method, but that would duplicate code. I also thought about using path but path can be duplicated, topic ids are never duplicated