From e943d9edb33bb91920b3a25ce6cc6b0f463562b7 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 17 Jan 2024 18:35:29 -0600 Subject: [PATCH] Fix Broken PDF Scraping in Sphinx This might be caused by a refactor that PyMuPDF is currently doing. This library is used to read the OMG spec table of contents to get the links. I could look into this further to see if this was intentional or a bug, but the fix seems to be trivial. --- docs/sphinx_extensions/links.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/sphinx_extensions/links.py b/docs/sphinx_extensions/links.py index 6d5ffc803a3..8d4222abbd3 100644 --- a/docs/sphinx_extensions/links.py +++ b/docs/sphinx_extensions/links.py @@ -258,7 +258,10 @@ def add_omg_spec(app, slug, version, our_name=None, display_name=None): if kind == fitz.LINK_GOTO: loc = 'page={}&view=FitH,{}'.format(page, dest['to'].y) elif kind == fitz.LINK_NAMED: - loc = dest['name'] + if 'name' in dest: + loc = dest['name'] + else: + loc = dest['nameddest'] else: continue