Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix internal links so that they work with latest ReportLab #777

Merged
merged 2 commits into from Jun 3, 2019

Conversation

akrabat
Copy link
Member

@akrabat akrabat commented Jun 2, 2019

Prior to ReportLab 3.5.19, a link that wasn't well-formed was assumed to
be an internal anchor. This was fixed in 3.5.19, so we now need to
prefix all internal links we generate with #.

This fixes #772

To Test:

Given test.rst:

===============================
Document with Table of Contents
===============================


.. contents:: Table of Contents
   :depth: 2

Heading 1
=========

Normal, **Bold**, *Italic*.

This is a paragraph in Page 1 [#]_

.. [#] This is a footnote in page 1

Run:

rst2pdf test.rst

Open the resulting test.pdf and resize into a vertically narrow window and ensure that

  • The TOC link takes you to the Heading 1 section
  • The footnote at the end of the paragraph takes you to the footnote
  • The link in the footnote takes you back the paragraph

Test with ReportLab 3.5.12 and then update ReportLab to the latest, rebuild and test again.

@akrabat akrabat added this to the 0.95 milestone Jun 2, 2019
@akrabat akrabat changed the title External links must start with a # Make external links work with latest ReportLab Jun 2, 2019
@akrabat akrabat changed the title Make external links work with latest ReportLab Fix internal links so that they work with latest ReportLab Jun 2, 2019
Prior to ReportLab 3.5.19, a link that wasn't well-formed was assumed to
be an internal anchor. This was [fixed][1] in 3.5.19, so we now need to
prefix all internal links we generate with `#`.

[1]: https://bitbucket.org/rptlab/reportlab/commits/c46115a85b61f4822026e72f5949a4fb1b63ba73
@oz123 oz123 merged commit 8b2c17a into rst2pdf:master Jun 3, 2019
@akrabat akrabat deleted the 772-fix-internal-links branch December 18, 2019 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal links (TOC, sections and figures) have been broken since reportlab updated to 3.5.19
2 participants