Skip to content

Commit

Permalink
Fixed issue where explicit targets for thumbnail directives where ign…
Browse files Browse the repository at this point in the history
…ored, making thumbnails unreferrable
  • Loading branch information
jonascj committed Aug 1, 2021
1 parent 85da3e3 commit 1871129
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Issue where explicit targets for thumbnails where ignored.
`.. _my target:` before a thumbnail directive would not make the thumbnail
referrable by `:ref:Title <my target>`.


## [0.9.3] - 2021-04-27

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions sphinxcontrib_images_lightbox2/lightbox2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ def visit_image_node_html(self, writer, node):
writer.body.append(u'''<a ''')
else:
writer.body.append(u'''<a class="{cls}"'''.format(cls=' '.join(node['classes']),))

writer.body.append(
u'''
data-lightbox="{group}"
href="{href}"
title="{title}"
data-title="{title}"
id="{id}"
>'''.format( group='group-%s' % node['group'] if node['group'] else node['uri'],
href=node['uri'],
title=node['title'] + node['content'],
id = node['ids'][0] # Only one id attribute allowed
))
writer.body.append(
'''<img src="{src}"
Expand Down

0 comments on commit 1871129

Please sign in to comment.