mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix broken TOC of PDFs if section includes an image
If someone adds an image to a section it will be added to the sidebar TOC of a PDF, too. A PDF viewer will show the "width and height" data instead of an image. So we need to filter out images for this with the optional "short title" of latex sections.
This commit is contained in:
11
tests/roots/test-image-in-section/conf.py
Normal file
11
tests/roots/test-image-in-section/conf.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
master_doc = 'index'
|
||||
|
||||
rst_epilog = '''
|
||||
.. |picture| image:: pic.png
|
||||
:width: 15pt
|
||||
:height: 15pt
|
||||
:alt: alternative_text
|
||||
'''
|
||||
|
||||
18
tests/roots/test-image-in-section/index.rst
Normal file
18
tests/roots/test-image-in-section/index.rst
Normal file
@@ -0,0 +1,18 @@
|
||||
test-image-in-section
|
||||
=====================
|
||||
this is dummy content
|
||||
|
||||
|
||||
|picture| Test section
|
||||
----------------------
|
||||
blah blah blah
|
||||
|
||||
|
||||
Another section
|
||||
---------------
|
||||
another blah
|
||||
|
||||
|
||||
Other [blah] |picture| section
|
||||
------------------------------
|
||||
other blah
|
||||
BIN
tests/roots/test-image-in-section/pic.png
Normal file
BIN
tests/roots/test-image-in-section/pic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 218 B |
Reference in New Issue
Block a user